Package org.takes.facets.auth.signatures
Class SiHmac
- java.lang.Object
-
- org.takes.facets.auth.signatures.SiHmac
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
bitlength()
Signature bit length.byte[]
sign(byte[] data)
Create signature for data bytes.
-
-
-
Field Detail
-
HMAC256
public static final int HMAC256
The HMAC 256 bit variant.- See Also:
- Constant Field Values
-
HMAC384
public static final int HMAC384
The HMAC 384 bit variant.- See Also:
- Constant Field Values
-
HMAC512
public static final int HMAC512
The HMAC 512 bit variant.- See Also:
- Constant Field Values
-
-
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 keybits
- The signature bit length
-
SiHmac
public SiHmac(byte[] key, int bits)
Ctor.- Parameters:
key
- The encryption keybits
- 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 interfaceSignature
- Parameters:
data
- The data to be signed- Returns:
- Signature
- Throws:
IOException
- If anything fails
-
bitlength
public int bitlength()
Signature bit length.- Returns:
- The bitlength
-
-