public class AESECBCmd extends Object
AESECBCmd implements AES ECB block cipher commands for the YubiHSM.| Modifier and Type | Method and Description |
|---|---|
static boolean |
compare(DeviceHandler deviceHandler,
int keyHandle,
String cipherText,
String plaintext)
AES ECB decrypt a cipher text using a specific key handle, and then compare it with the supplied plaintext.
|
static String |
decrypt(DeviceHandler deviceHandler,
int keyHandle,
String cipherText)
AES ECB decrypt a cipher text using a specific key handle.
|
static String |
encrypt(DeviceHandler deviceHandler,
int keyHandle,
String plaintext)
AES ECB encrypt a plaintext string using a specific key handle.
|
public static String encrypt(DeviceHandler deviceHandler, int keyHandle, String plaintext) throws YubiHSMInputException, YubiHSMErrorException, YubiHSMCommandFailedException
deviceHandler - the device handlerkeyHandle - the key handle to use when encrypting AES ECBplaintext - the plaintext stringYubiHSMInputException - if an argument does not validateYubiHSMErrorException - if validation fail for some values returned by the YubiHSMYubiHSMCommandFailedException - if the YubiHSM fail to execute the commandpublic static String decrypt(DeviceHandler deviceHandler, int keyHandle, String cipherText) throws YubiHSMErrorException, YubiHSMInputException, YubiHSMCommandFailedException
deviceHandler - the device handlerkeyHandle - the key handle to use when decrypting AES ECBcipherText - the cipher stringYubiHSMInputException - if an argument does not validateYubiHSMErrorException - if validation fail for some values returned by the YubiHSMYubiHSMCommandFailedException - if the YubiHSM fail to execute the commandpublic static boolean compare(DeviceHandler deviceHandler, int keyHandle, String cipherText, String plaintext) throws YubiHSMInputException, YubiHSMErrorException, YubiHSMCommandFailedException
deviceHandler - the device handlerkeyHandle - the key handle to use when comparing AES ECB cipher with plaintextcipherText - the cipher stringplaintext - the plaintext stringYubiHSMInputException - if an argument does not validateYubiHSMErrorException - if validation fail for some values returned by the YubiHSMYubiHSMCommandFailedException - if the YubiHSM fail to execute the commandCopyright © 2011-2016 United ID. All Rights Reserved.