Class SiHmac

  • All Implemented Interfaces:
    Signature

    public final class SiHmac
    extends Object
    implements Signature
    HMAC codec which supports 256, 384 and 512 bit hash.

    The class is immutable and thread-safe.

    Since:
    1.4
    • Constructor Detail

      • SiHmac

        public SiHmac​(String key)
        Ctor.
        Parameters:
        key - The encryption key
      • SiHmac

        public SiHmac​(String key,
                      int bits)
        Ctor.
        Parameters:
        key - The encryption key
        bits - The signature bit length
      • SiHmac

        public SiHmac​(byte[] key,
                      int bits)
        Ctor.
        Parameters:
        key - The encryption key
        bits - The signature bit length
    • Method Detail

      • sign

        public byte[] sign​(byte[] data)
                    throws IOException
        Description copied from interface: Signature
        Create signature for data bytes.
        Specified by:
        sign in interface Signature
        Parameters:
        data - The data to be signed
        Returns:
        Signature
        Throws:
        IOException - If anything fails
      • bitlength

        public int bitlength()
        Signature bit length.
        Returns:
        The bitlength