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
public class ECSignatureGenerator extends ECSignature implements SignatureGeneratorConfiguration
Elliptic curve signature generator. ExtendsECSignature
adding the ability to sign JWT.- Since:
- 1.0
- Author:
- Sergio del Amo
- See Also:
- JSON Web Token (JWT) with EC signature
-
-
Field Summary
-
Fields inherited from class io.micronaut.security.token.jwt.signature.AbstractSignatureConfiguration
algorithm
-
-
Constructor Summary
Constructors Constructor Description ECSignatureGenerator(ECSignatureGeneratorConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.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, java.security.interfaces.ECPrivateKey privateKey)
-
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 Detail
-
ECSignatureGenerator
public ECSignatureGenerator(ECSignatureGeneratorConfiguration config)
- Parameters:
config
- Instance ofECSignatureConfiguration
-
-
Method Detail
-
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 java.security.interfaces.ECPrivateKey privateKey) throws com.nimbusds.jose.JOSEException
- Parameters:
claims
- The JWT ClaimsprivateKey
- The EC Private Key- Returns:
- A signed JWT
- Throws:
com.nimbusds.jose.JOSEException
- thrown in the JWT signing
-
-