Interface Signature

    • Method Summary

      Modifier and Type Method Description
      byte[] encode​(byte[] signature)
      Encode the signature as blog
      java.lang.String getSignatureName()  
      void initSign​(java.security.PrivateKey prvkey)
      Initialize this signature with the given private key for signing.
      void initVerify​(java.security.PublicKey pubkey)
      Initialize this signature with the given public key for signature verification.
      byte[] sign()
      Compute the signature.
      void update​(byte[] H)
      Convenience method, same as calling update(byte[], int, int) with offset as 0 and H.length.
      void update​(byte[] H, int off, int len)
      Update the computed signature with the given data.
      boolean verify​(byte[] sig)
      Verify against the given signature.
    • Method Detail

      • getSignatureName

        java.lang.String getSignatureName()
      • initVerify

        void initVerify​(java.security.PublicKey pubkey)
        Initialize this signature with the given public key for signature verification. Note that subsequent calls to either initVerify(PublicKey) or initSign(PrivateKey) will overwrite prior initialization.
        Parameters:
        pubkey - the public key to use for signature verification
      • initSign

        void initSign​(java.security.PrivateKey prvkey)
        Initialize this signature with the given private key for signing. Note that subsequent calls to either initVerify(PublicKey) or initSign(PrivateKey) will overwrite prior initialization.
        Parameters:
        prvkey - the private key to use for signing
      • update

        void update​(byte[] H)
        Convenience method, same as calling update(byte[], int, int) with offset as 0 and H.length.
        Parameters:
        H - the byte-array to update with
      • update

        void update​(byte[] H,
                    int off,
                    int len)
        Update the computed signature with the given data.
        Parameters:
        H - byte-array to update with
        off - offset within the array
        len - length until which to compute
      • sign

        byte[] sign()
        Compute the signature.
        Returns:
        the computed signature
      • encode

        byte[] encode​(byte[] signature)
        Encode the signature as blog
        Parameters:
        signature - the signature to encode
        Returns:
        Encoded signature
      • verify

        boolean verify​(byte[] sig)
        Verify against the given signature.
        Parameters:
        sig - the signature to verify against
        Returns:
        true on successful verification, false on failure