Interface Signature

    • Method Detail

      • initVerifier

        void initVerifier​(SessionContext session,
                          java.security.PublicKey key)
                   throws java.lang.Exception
        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.lang.Exception - If failed to initialize
      • initSigner

        void initSigner​(SessionContext session,
                        java.security.PrivateKey key)
                 throws java.lang.Exception
        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
        Throws:
        java.lang.Exception - If failed to initialize
      • update

        default void update​(SessionContext session,
                            byte[] hash)
                     throws java.lang.Exception
        Update the computed signature with the given data
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        hash - The hash data buffer
        Throws:
        java.lang.Exception - If failed to update
        See Also:
        update(SessionContext, byte[], int, int)
      • update

        void update​(SessionContext session,
                    byte[] hash,
                    int off,
                    int len)
             throws java.lang.Exception
        Update the computed signature with the given data
        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
        Throws:
        java.lang.Exception - If failed to update
      • verify

        boolean verify​(SessionContext session,
                       byte[] sig)
                throws java.lang.Exception
        Verify against the given 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
      • sign

        byte[] sign​(SessionContext session)
             throws java.lang.Exception
        Compute the signature
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        Returns:
        The signature value
        Throws:
        java.lang.Exception - If failed to calculate the signature