Class Signature


  • public final class Signature
    extends java.lang.Object
    Signature for signing hash data.
    • Method Detail

      • signHashData

        @NonNull
        public static byte[] signHashData​(@NonNull
                                          java.security.PrivateKey key,
                                          @NonNull
                                          byte[] hashData,
                                          @NonNull
                                          Signature.SignatureDigestAlgorithm algorithm)
                                   throws java.io.IOException,
                                          java.security.SignatureException,
                                          java.security.NoSuchAlgorithmException,
                                          java.security.InvalidKeyException
        Signs hash data. The method will doing as follows: 1. Encode the object identifier of the digest algorithm and the hash data in DER format if the SignatureDigestAlgorithm is not NONE. 2. Signed the encoded data with "NONEwithRSA" algorithm.
        Throws:
        java.io.IOException
        java.security.SignatureException
        java.security.NoSuchAlgorithmException
        java.security.InvalidKeyException