Class ECSignatureGenerator
java.lang.Object
io.micronaut.security.token.jwt.signature.AbstractSignatureConfiguration
io.micronaut.security.token.jwt.signature.ec.ECSignature
io.micronaut.security.token.jwt.signature.ec.ECSignatureGenerator
- All Implemented Interfaces:
SignatureConfiguration
,SignatureGeneratorConfiguration
Elliptic curve signature generator. Extends
ECSignature
adding the ability 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 ECPrivateKey privateKey, @Nullable String kid) Methods inherited from class io.micronaut.security.token.jwt.signature.ec.ECSignature
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
-
ECSignatureGenerator
- Parameters:
config
- Instance ofECSignatureConfiguration
-
-
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 ECPrivateKey privateKey, @Nullable @Nullable String kid) throws com.nimbusds.jose.JOSEException - Parameters:
claims
- The JWT ClaimsprivateKey
- The EC Private Keykid
- Key ID- Returns:
- A signed JWT
- Throws:
com.nimbusds.jose.JOSEException
- thrown in the JWT signing
-