Package io.smallrye.jwt.build
Interface JwtSignature
-
- All Known Subinterfaces:
JwtClaimsBuilder,JwtSignatureBuilder
public interface JwtSignatureJWT JsonWebSignature.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JwtEncryptionBuilderinnerSign()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.JwtEncryptionBuilderinnerSign(String keyLocation)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.JwtEncryptionBuilderinnerSign(PrivateKey signingKey)Sign the claims withPrivateKeyand encrypt the inner JWT by moving toJwtEncryptionBuilder.JwtEncryptionBuilderinnerSign(SecretKey signingKey)Sign the claims withSecretKeyand encrypt the inner JWT by moving toJwtEncryptionBuilder.JwtEncryptionBuilderinnerSignWithSecret(String secret)Sign the claims with a secret key string and encrypt the inner JWT by moving toJwtEncryptionBuilder.Stringsign()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.Stringsign(String keyLocation)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.Stringsign(PrivateKey signingKey)Sign the claims withPrivateKey.Stringsign(SecretKey signingKey)Sign the claims withSecretKey'HS256' algorithm will be used unless a different algorithm has been set withJwtSignatureBuilderor 'smallrye.jwt.new-token.signature-algorithm' property.StringsignWithSecret(String secret)Sign the claims with a secret key string.
-
-
-
Method Detail
-
sign
String sign(PrivateKey signingKey) throws JwtSignatureException
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
String sign(SecretKey signingKey) throws JwtSignatureException
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
String sign(String keyLocation) throws JwtSignatureException
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
String sign() throws JwtSignatureException
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
String signWithSecret(String secret) throws JwtSignatureException
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
JwtEncryptionBuilder innerSign(PrivateKey signingKey) throws JwtSignatureException
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
JwtEncryptionBuilder innerSign(SecretKey signingKey) throws JwtSignatureException
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
JwtEncryptionBuilder innerSign(String keyLocation) throws JwtSignatureException
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
JwtEncryptionBuilder innerSign() throws JwtSignatureException
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
JwtEncryptionBuilder innerSignWithSecret(String secret) throws JwtSignatureException
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
-
-