Class SignatureSigner


  • public class SignatureSigner
    extends Object
    The SignatureSigner is used to actually sign a message with a private key.

    This version is specific to RSA.

    Class is immutable. @Immutable

    • Constructor Detail

      • SignatureSigner

        public SignatureSigner()
    • Method Detail

      • sign

        @Nonnull
        public byte[] sign​(@Nonnull
                           RSAPrivateKey privateKey,
                           @Nonnull
                           byte[] message,
                           @Nonnull
                           String algorithm)
        Sign the given message using the given private key
        Parameters:
        privateKey - the private key to use to sign the message
        message - the message to sign, must not be null or empty
        algorithm - the algorithm to sign
        Returns:
        an RSA signature of the message made using given private key and algorithm
        Throws:
        SignedRequestException - if algorithm is invalid, key is invalid or signing fails