Class AbstractSecurityKeySignature

    • Field Detail

      • keyType

        private final java.lang.String keyType
      • challengeDigest

        private java.security.MessageDigest challengeDigest
    • Constructor Detail

      • AbstractSecurityKeySignature

        protected AbstractSecurityKeySignature​(java.lang.String keyType)
    • Method Detail

      • initVerifier

        public void initVerifier​(SessionContext session,
                                 java.security.PublicKey key)
                          throws java.security.GeneralSecurityException
        Specified by:
        initVerifier in interface Signature
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        key - The PublicKey to be used for verifying signatures
        Throws:
        java.security.GeneralSecurityException
      • update

        public void update​(SessionContext session,
                           byte[] hash,
                           int off,
                           int len)
        Description copied from interface: Signature
        Update the computed signature with the given data
        Specified by:
        update in interface Signature
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        hash - The hash data buffer
        off - Offset of hash data in buffer
        len - Length of hash data
      • getSignatureKeyType

        protected abstract java.lang.String getSignatureKeyType()
      • getDelegateSignature

        protected abstract Signature getDelegateSignature()
      • verify

        public boolean verify​(SessionContext session,
                              byte[] sig)
                       throws java.lang.Exception
        Description copied from interface: Signature
        Verify against the given signature
        Specified by:
        verify in interface Signature
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        sig - The signed data
        Returns:
        true if signature is valid
        Throws:
        java.lang.Exception - If failed to extract signed data for validation
      • initSigner

        public void initSigner​(SessionContext session,
                               java.security.PrivateKey key)
        Specified by:
        initSigner in interface Signature
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        key - The PrivateKey to be used for signing
      • sign

        public byte[] sign​(SessionContext session)
        Description copied from interface: Signature
        Compute the signature
        Specified by:
        sign in interface Signature
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        Returns:
        The signature value