Class RSASignatureGenerator

All Implemented Interfaces:
SignatureConfiguration, SignatureGeneratorConfiguration

public class RSASignatureGenerator extends RSASignature implements SignatureGeneratorConfiguration
RSA signature Generator. Expands RSASignature to add methods to sign JWT.
Since:
1.0
Author:
Sergio del Amo
See Also:
  • Constructor Details

  • 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 interface SignatureGeneratorConfiguration
      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 Claims
      privateKey - The RSA Private Key
      Returns:
      A signed JWT
      Throws:
      com.nimbusds.jose.JOSEException - thrown in the JWT signing