public class AEADCmd extends Object
AEADCmd implements AEAD commands for the YubiHSM| Modifier and Type | Method and Description |
|---|---|
static Map<String,String> |
generateAEAD(DeviceHandler device,
String nonce,
int keyHandle,
byte[] data)
Generate AEADCmd block from data for a specific key and nonce.
|
static Map<String,String> |
generateBufferAEAD(DeviceHandler device,
String nonce,
int keyHandle)
Generate AEAD block of data buffer for a specific key.
|
static Map<String,String> |
generateRandomAEAD(DeviceHandler device,
String nonce,
int keyHandle,
int size)
Generate a random AEAD block using the YubiHSM internal TRNG.
|
static boolean |
validateAEAD(DeviceHandler device,
String nonce,
int keyHandle,
String aead,
byte[] plaintext)
Validate an AEAD using the YubiHSM, matching it against some known plain text.
|
public static Map<String,String> generateAEAD(DeviceHandler device, String nonce, int keyHandle, byte[] data) throws YubiHSMInputException, YubiHSMCommandFailedException, YubiHSMErrorException
device - the YubiHSM device handlernonce - the noncekeyHandle - the key to usedata - is the byte array to turn into an AEADYubiHSMInputException - argument exceptionsYubiHSMCommandFailedException - command failed exceptionYubiHSMErrorException - error exceptionpublic static Map<String,String> generateRandomAEAD(DeviceHandler device, String nonce, int keyHandle, int size) throws YubiHSMInputException, YubiHSMCommandFailedException, YubiHSMErrorException
device - the YubiHSM device handlernonce - the nonce or public_idkeyHandle - the key to usesize - the resulting byte length of the AEADYubiHSMInputException - argument exceptionsYubiHSMCommandFailedException - command failed exceptionYubiHSMErrorException - error exceptionpublic static Map<String,String> generateBufferAEAD(DeviceHandler device, String nonce, int keyHandle) throws YubiHSMInputException, YubiHSMCommandFailedException, YubiHSMErrorException
device - the YubiHSM device handlernonce - the noncekeyHandle - the key to useYubiHSMInputException - argument exceptionsYubiHSMCommandFailedException - command failed exceptionYubiHSMErrorException - error exceptionpublic static boolean validateAEAD(DeviceHandler device, String nonce, int keyHandle, String aead, byte[] plaintext) throws YubiHSMInputException, YubiHSMCommandFailedException, YubiHSMErrorException
device - the YubiHSM devicenonce - the nonce or public_idkeyHandle - the key to useaead - the AEAD (hex string)plaintext - the plain text dataYubiHSMInputException - argument exceptionsYubiHSMCommandFailedException - command failed exceptionYubiHSMErrorException - error exceptionCopyright © 2011-2016 United ID. All Rights Reserved.