Class RSASignatureGenerator
java.lang.Object
io.micronaut.security.token.jwt.signature.AbstractSignatureConfiguration
io.micronaut.security.token.jwt.signature.rsa.RSASignature
io.micronaut.security.token.jwt.signature.rsa.RSASignatureGenerator
- All Implemented Interfaces:
SignatureConfiguration
,SignatureGeneratorConfiguration
RSA signature Generator. Expands
RSASignature
to add methods to sign JWT.- Since:
- 1.0
- Author:
- Sergio del Amo
- See Also:
-
Field Summary
Fields inherited from class io.micronaut.security.token.jwt.signature.AbstractSignatureConfiguration
algorithm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.nimbusds.jwt.SignedJWT
sign
(com.nimbusds.jwt.JWTClaimsSet claims) Generate a signed JWT based on claims.protected com.nimbusds.jwt.SignedJWT
signWithPrivateKey
(com.nimbusds.jwt.JWTClaimsSet claims, @NonNull RSAPrivateKey privateKey) Methods inherited from class io.micronaut.security.token.jwt.signature.rsa.RSASignature
supportedAlgorithmsMessage, supports, verify
Methods inherited from class io.micronaut.security.token.jwt.signature.AbstractSignatureConfiguration
getAlgorithm, setAlgorithm
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.security.token.jwt.signature.SignatureConfiguration
supportedAlgorithmsMessage, supports, verify
-
Constructor Details
-
RSASignatureGenerator
- Parameters:
config
- Instance ofRSASignatureConfiguration
-
-
Method Details
-
sign
public com.nimbusds.jwt.SignedJWT sign(com.nimbusds.jwt.JWTClaimsSet claims) throws com.nimbusds.jose.JOSEException Description copied from interface:SignatureGeneratorConfiguration
Generate a signed JWT based on claims.- Specified by:
sign
in interfaceSignatureGeneratorConfiguration
- Parameters:
claims
- the provided claims- Returns:
- the signed JWT
- Throws:
com.nimbusds.jose.JOSEException
- could be thrown while signing the JWT token
-
signWithPrivateKey
protected com.nimbusds.jwt.SignedJWT signWithPrivateKey(com.nimbusds.jwt.JWTClaimsSet claims, @NonNull @NonNull RSAPrivateKey privateKey) throws com.nimbusds.jose.JOSEException - Parameters:
claims
- The JWT ClaimsprivateKey
- The RSA Private Key- Returns:
- A signed JWT
- Throws:
com.nimbusds.jose.JOSEException
- thrown in the JWT signing
-