Loading…

Kryptel/Java

IMacSetup interface

Declaration

package com.kryptel.mac;

public interface IMacSetup {
  void SetBase(UUID cid) throws Exception;
  void SetBase(IKryptelComponent comp) throws Exception;

  void SetKey(byte[] key, int start, int size) throws Exception;
}

Description

This interface sets HMAC key and HMAC's base hash function.

SetBase

void SetBase(UUID cid) throws Exception;
void SetBase(IKryptelComponent comp) throws Exception;

Sets the base hash function that will be used for HMAC computation. The first form creates the hash function by the provided Component ID and uses it with default parameters. If you need to use the hash function with some specific parameters, instantiate it, set the desired parameters using IHashFunctionParams interface, and pass the function's IKryptelComponent.

Note that the hash function component passed to the second SetBase form is not used or discarded on cleanup. HMAC calls the hash function's IComponentState.Clone and uses the copy of the component.

SetKey

void SetKey(byte[] key, int start, int size) throws Exception;

Sets HMAC binary key. If size is not equal to the base hash function's block size, the key is normalized – either truncated or padded with zero bytes.