Package io.smallrye.jwt.build
Interface JwtSignature
- All Known Subinterfaces:
JwtClaimsBuilder,JwtSignatureBuilder
public interface JwtSignature
JWT JsonWebSignature.
-
Method Summary
Modifier and TypeMethodDescriptionSign the claims with a key loaded from the location set with the "smallrye.jwt.sign.key.location" property or the key content set with the "smallrye.jwt.sign.key" property and encrypt the inner JWT by moving toJwtEncryptionBuilder.Sign the claims with a private or secret key loaded from the custom location which can point to a PEM, JWK or JWK set keys and encrypt the inner JWT by moving toJwtEncryptionBuilder.innerSign(PrivateKey signingKey) Sign the claims withPrivateKeyand encrypt the inner JWT by moving toJwtEncryptionBuilder.Sign the claims withSecretKeyand encrypt the inner JWT by moving toJwtEncryptionBuilder.innerSignWithSecret(String secret) Sign the claims with a secret key string and encrypt the inner JWT by moving toJwtEncryptionBuilder.sign()Sign the claims with a key loaded from the location set with the "smallrye.jwt.sign.key.location" property or the key content set with the "smallrye.jwt.sign.key" property.Sign the claims with a private or secret key loaded from the custom location which can point to a PEM, JWK or JWK set keys.sign(PrivateKey signingKey) Sign the claims withPrivateKey.Sign the claims withSecretKey'HS256' algorithm will be used unless a different algorithm has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property.signWithSecret(String secret) Sign the claims with a secret key string.
-
Method Details
-
sign
Sign the claims withPrivateKey. 'RS256' algorithm will be used unless a different algorithm has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property. A key of size 2048 bits or larger MUST be used with the 'RS256' algorithm.- Parameters:
signingKey- the signing key- Returns:
- signed JWT token
- Throws:
JwtSignatureException- the exception if the signing operation has failed
-
sign
Sign the claims withSecretKey'HS256' algorithm will be used unless a different algorithm has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property.- Parameters:
signingKey- the signing key- Returns:
- signed JWT token
- Throws:
JwtSignatureException- the exception if the signing operation has failed
-
sign
Sign the claims with a private or secret key loaded from the custom location which can point to a PEM, JWK or JWK set keys. 'RS256' algorithm will be used unless a different algorithm has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property. A key of size 2048 bits or larger MUST be used with the 'RS256' algorithm.- Parameters:
keyLocation- the signing key location- Returns:
- signed JWT token
- Throws:
JwtSignatureException- the exception if the signing operation has failed
-
sign
Sign the claims with a key loaded from the location set with the "smallrye.jwt.sign.key.location" property or the key content set with the "smallrye.jwt.sign.key" property. Keys in PEM, JWK and JWK formats are supported. 'RS256' algorithm will be used unless a different algorithm has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property. A key of size 2048 bits or larger MUST be used with the 'RS256' algorithm.- Returns:
- signed JWT token
- Throws:
JwtSignatureException- the exception if the signing operation has failed
-
signWithSecret
Sign the claims with a secret key string. 'HS256' algorithm will be used unless a different algorithm has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property.- Parameters:
secret- the secret- Returns:
- signed JWT token
- Throws:
JwtSignatureException- the exception if the signing operation has failed
-
innerSign
Sign the claims withPrivateKeyand encrypt the inner JWT by moving toJwtEncryptionBuilder. 'RS256' algorithm will be used unless a different algorithm has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property. A key of size 2048 bits or larger MUST be used with the 'RS256' algorithm.- Parameters:
signingKey- the signing key- Returns:
- JwtEncryption
- Throws:
JwtSignatureException- the exception if the inner JWT signing operation has failed
-
innerSign
Sign the claims withSecretKeyand encrypt the inner JWT by moving toJwtEncryptionBuilder. 'HS256' algorithm will be used unless a different algorithm has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property.- Parameters:
signingKey- the signing key- Returns:
- JwtEncryption
- Throws:
JwtSignatureException- the exception if the inner JWT signing operation has failed
-
innerSign
Sign the claims with a private or secret key loaded from the custom location which can point to a PEM, JWK or JWK set keys and encrypt the inner JWT by moving toJwtEncryptionBuilder. 'RS256' algorithm will be used unless a different one has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property. A key of size 2048 bits or larger MUST be used with the 'RS256' algorithm.- Parameters:
keyLocation- the signing key location- Returns:
- JwtEncryption
- Throws:
JwtSignatureException- the exception if the inner JWT signing operation has failed
-
innerSign
Sign the claims with a key loaded from the location set with the "smallrye.jwt.sign.key.location" property or the key content set with the "smallrye.jwt.sign.key" property and encrypt the inner JWT by moving toJwtEncryptionBuilder. Signing keys in PEM, JWK and JWK formats are supported. A key of size 2048 bits or larger MUST be used with the 'RS256' algorithm or 'smallrye.jwt.new-token.signature-algorithm' property.- Returns:
- JwtEncryption
- Throws:
JwtSignatureException- the exception if the inner JWT signing operation has failed
-
innerSignWithSecret
Sign the claims with a secret key string and encrypt the inner JWT by moving toJwtEncryptionBuilder. 'HS256' algorithm will be used unless a different one has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property.- Parameters:
secret- the secret- Returns:
- signed JWT token
- Throws:
JwtSignatureException- the exception if the signing operation has failed
-