public class HMACCmd extends Object
HMACCmd implements the HMAC SHA1 commands for the YubiHSM.| Modifier and Type | Method and Description |
|---|---|
static byte[] |
execHMACSHA1_Raw(DeviceHandler deviceHandler,
byte[] data,
int keyHandle,
byte flags)
Generate HMAC SHA1 using a key handle in the YubiHSM.
|
static Map<String,String> |
generateHMACSHA1(DeviceHandler deviceHandler,
byte[] data,
int keyHandle,
byte flags,
boolean last,
boolean toBuffer)
Generate HMAC SHA1 using a key handle in the YubiHSM.
|
static Map<String,String> |
next(DeviceHandler deviceHandler,
byte[] data,
int keyHandle,
boolean last,
boolean toBuffer)
Add more input to the HMAC SHA1.
|
public static Map<String,String> generateHMACSHA1(DeviceHandler deviceHandler, byte[] data, int keyHandle, byte flags, boolean last, boolean toBuffer) throws YubiHSMCommandFailedException, YubiHSMErrorException, YubiHSMInputException
deviceHandler - the device handlerdata - the data used to generate the SHA1keyHandle - the key handle to use in the YubiHSMflags - the commands flags, send (byte) 0 to use defaultslast - set to false to not get a hash generated for the initial requesttoBuffer - set to true to get the SHA1 stored into the internal buffer, for use in some other cryptographic operations.YubiHSMCommandFailedException - if the YubiHSM fail to execute the commandYubiHSMErrorException - if validation fail for some values returned by the YubiHSMYubiHSMInputException - if an argument does not validatepublic static byte[] execHMACSHA1_Raw(DeviceHandler deviceHandler, byte[] data, int keyHandle, byte flags) throws YubiHSMCommandFailedException, YubiHSMErrorException, YubiHSMInputException
deviceHandler - the device handlerdata - the data used to generate the SHA1keyHandle - the key handle to use in the YubiHSMflags - the commands flags, send (byte) 0 to use defaultsYubiHSMCommandFailedException - if the YubiHSM fail to execute the commandYubiHSMErrorException - if validation fail for some values returned by the YubiHSMYubiHSMInputException - if an argument does not validatepublic static Map<String,String> next(DeviceHandler deviceHandler, byte[] data, int keyHandle, boolean last, boolean toBuffer) throws YubiHSMCommandFailedException, YubiHSMErrorException, YubiHSMInputException
deviceHandler - the device handlerdata - the data to add before generating SHA1keyHandle - the key handle to use in the YubiHSMlast - set to false to not get a hash generated after this calltoBuffer - set to true to get the SHA1 stored into the internal buffer, for use in some other cryptographic operations.YubiHSMCommandFailedException - if the YubiHSM fail to execute the commandYubiHSMErrorException - if validation fail for some values returned by the YubiHSMYubiHSMInputException - if an argument does not validateCopyright © 2011-2016 United ID. All Rights Reserved.