@EachBean(value=SecretSignatureConfiguration.class) public class SecretSignature extends AbstractSignatureConfiguration implements SignatureGeneratorConfiguration
algorithm
Constructor and Description |
---|
SecretSignature(SecretSignatureConfiguration config) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getSecret() |
void |
setSecret(java.lang.String secret)
Sets secret byte[] with a string with UTF_8 charset.
|
com.nimbusds.jwt.SignedJWT |
sign(com.nimbusds.jwt.JWTClaimsSet claims)
Generate a signed JWT based on claims.
|
java.lang.String |
supportedAlgorithmsMessage() |
boolean |
supports(com.nimbusds.jose.JWSAlgorithm algorithm)
Whether this signature configuration supports this algorithm.
|
boolean |
verify(com.nimbusds.jwt.SignedJWT jwt)
Verify a signed JWT.
|
getAlgorithm, setAlgorithm
public SecretSignature(SecretSignatureConfiguration config)
config
- SecretSignatureConfiguration
configurationpublic java.lang.String supportedAlgorithmsMessage()
supportedAlgorithmsMessage
in interface SignatureConfiguration
public boolean supports(com.nimbusds.jose.JWSAlgorithm algorithm)
SignatureConfiguration
supports
in interface SignatureConfiguration
algorithm
- the signature algorithmpublic com.nimbusds.jwt.SignedJWT sign(com.nimbusds.jwt.JWTClaimsSet claims) throws com.nimbusds.jose.JOSEException
SignatureGeneratorConfiguration
sign
in interface SignatureGeneratorConfiguration
claims
- the provided claimscom.nimbusds.jose.JOSEException
- could be thrown while signing the JWT tokenpublic boolean verify(com.nimbusds.jwt.SignedJWT jwt) throws com.nimbusds.jose.JOSEException
SignatureConfiguration
verify
in interface SignatureConfiguration
jwt
- the signed JWTcom.nimbusds.jose.JOSEException
- exception when verifying the JWTpublic java.lang.String getSecret()
public void setSecret(java.lang.String secret)
secret
- UTF_8 string