Exemple #1
0
 /**
  * Processes the first <code>len</code> bytes in <code>input</code>, starting at <code>offset
  * </code>.
  *
  * @param input the input buffer.
  * @param offset the offset in <code>input</code> where the input starts.
  * @param len the number of bytes to process.
  */
 protected void engineUpdate(byte input[], int offset, int len) {
   hmac.update(input, offset, len);
 }
Exemple #2
0
 protected void engineUpdate(ByteBuffer input) {
   hmac.update(input);
 }
Exemple #3
0
 /**
  * Processes the given byte.
  *
  * @param input the input byte to be processed.
  */
 protected void engineUpdate(byte input) {
   hmac.update(input);
 }
Exemple #4
0
 /**
  * Initializes the HMAC with the given secret key and algorithm parameters.
  *
  * @param key the secret key.
  * @param params the algorithm parameters.
  * @exception InvalidKeyException if the given key is inappropriate for initializing this MAC.
  * @exception InvalidAlgorithmParameterException if the given algorithm parameters are
  *     inappropriate for this MAC.
  */
 protected void engineInit(Key key, AlgorithmParameterSpec params)
     throws InvalidKeyException, InvalidAlgorithmParameterException {
   hmac.init(key, params);
 }
Exemple #5
0
 /**
  * Returns the length of the HMAC in bytes.
  *
  * @return the HMAC length in bytes.
  */
 protected int engineGetMacLength() {
   return hmac.getDigestLength();
 }
Exemple #6
0
 /**
  * Resets the HMAC for further use, maintaining the secret key that the HMAC was initialized with.
  */
 protected void engineReset() {
   hmac.reset();
 }
Exemple #7
0
 /**
  * Completes the HMAC computation and resets the HMAC for further use, maintaining the secret key
  * that the HMAC was initialized with.
  *
  * @return the HMAC result.
  */
 protected byte[] engineDoFinal() {
   return hmac.doFinal();
 }