java.lang.Object | ||
↳ | javax.crypto.MacSpi | |
↳ | com.sun.crypto.provider.HmacSHA1 |
This is an implementation of the HMAC-SHA1 algorithm.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Standard constructor, creates a new HmacSHA1 instance.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a clone if the implementation is cloneable.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Completes the HMAC computation and resets the HMAC for further use,
maintaining the secret key that the HMAC was initialized with.
| |||||||||||
Returns the length of the HMAC in bytes.
| |||||||||||
Initializes the HMAC with the given secret key and algorithm parameters.
| |||||||||||
Resets the HMAC for further use, maintaining the secret key that the
HMAC was initialized with.
| |||||||||||
Processes the first
len bytes in input ,
starting at offset . | |||||||||||
Processes the given byte.
| |||||||||||
Processes
input.remaining() bytes in the ByteBuffer
input , starting at input.position() . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
javax.crypto.MacSpi
| |||||||||||
From class
java.lang.Object
|
Standard constructor, creates a new HmacSHA1 instance. Verify the SunJCE provider in the constructor.
SecurityException | if fails to verify its own integrity |
---|---|
NoSuchAlgorithmException |
Returns a clone if the implementation is cloneable.
Completes the HMAC computation and resets the HMAC for further use, maintaining the secret key that the HMAC was initialized with.
Returns the length of the HMAC in bytes.
Initializes the HMAC with the given secret key and algorithm parameters.
key | the secret key. |
---|---|
params | the algorithm parameters. |
InvalidKeyException | if the given key is inappropriate for initializing this MAC. |
---|---|
InvalidAlgorithmParameterException | if the given algorithm parameters are inappropriate for this MAC. |
Resets the HMAC for further use, maintaining the secret key that the HMAC was initialized with.
Processes the first len
bytes in input
,
starting at offset
.
input | the input buffer. |
---|---|
offset | the offset in input where the input starts. |
len | the number of bytes to process. |
Processes the given byte.
input | the input byte to be processed. |
---|
Processes input.remaining()
bytes in the ByteBuffer
input
, starting at input.position()
.
Upon return, the buffer's position will be equal to its limit;
its limit will not have changed.
Subclasses should consider overriding this method if they can process ByteBuffers more efficiently than byte arrays.
input | the ByteBuffer |
---|