Class RSAAlgorithm

    • Constructor Detail

      • RSAAlgorithm

        RSAAlgorithm​(CryptoHelper crypto,
                     java.lang.String id,
                     java.lang.String algorithm,
                     RSAKeyProvider keyProvider)
              throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • RSAAlgorithm

        RSAAlgorithm​(java.lang.String id,
                     java.lang.String algorithm,
                     RSAKeyProvider keyProvider)
              throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • sign

        @Deprecated
        public byte[] sign​(byte[] headerBytes,
                           byte[] payloadBytes)
                    throws SignatureGenerationException
        Deprecated.
        Description copied from class: Algorithm
        Sign the given content using this Algorithm instance.
        Overrides:
        sign in class Algorithm
        Parameters:
        headerBytes - an array of bytes representing the base64 encoded header content to be verified against the signature.
        payloadBytes - an array of bytes representing the base64 encoded payload content to be verified against the signature.
        Returns:
        the signature in a base64 encoded array of bytes
        Throws:
        SignatureGenerationException - if the Key is invalid.
      • sign

        public byte[] sign​(byte[] contentBytes)
                    throws SignatureGenerationException
        Description copied from class: Algorithm
        Sign the given content using this Algorithm instance.
        Specified by:
        sign in class Algorithm
        Parameters:
        contentBytes - an array of bytes representing the base64 encoded content to be verified against the signature.
        Returns:
        the signature in a base64 encoded array of bytes
        Throws:
        SignatureGenerationException - if the Key is invalid.
      • getSigningKeyId

        public java.lang.String getSigningKeyId()
        Description copied from class: Algorithm
        Getter for the Id of the Private Key used to sign the tokens. This is usually specified as the `kid` claim in the Header.
        Overrides:
        getSigningKeyId in class Algorithm
        Returns:
        the Key Id that identifies the Signing Key or null if it's not specified.
      • providerForKeys

        static RSAKeyProvider providerForKeys​(java.security.interfaces.RSAPublicKey publicKey,
                                              java.security.interfaces.RSAPrivateKey privateKey)