public class Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
addLengthToData(byte[] data) |
static String |
byteArrayToHex(byte[] b) |
Object |
clone() |
static byte[] |
concatAllArrays(byte[] data1,
byte[]... remaining) |
static String |
getYubiKeyOtp(String otp) |
static String |
getYubiKeyPublicId(String otp) |
static byte[] |
hexToByteArray(String hex) |
static int |
leBAToBeInt(byte[] data) |
static int |
leBAToBeShort(byte[] data) |
static byte[] |
leIntToBA(int value) |
static byte[] |
leShortToByteArray(short value) |
static byte[] |
longToByteArray(long value) |
static byte[] |
rangeOfByteArray(byte[] data,
int offset,
int length) |
static byte[] |
validateByteArray(String name,
byte[] data,
int maxLength,
int exactLength,
int paddingLength) |
static byte[] |
validateCmdResponseBA(String name,
byte[] got,
byte[] expected) |
static String |
validateCmdResponseString(String name,
String got,
String expected) |
static byte[] |
validateNonce(byte[] nonce,
boolean padding) |
static String |
validateString(String name,
String data,
int maxLength,
int exactLength) |
public static byte[] addLengthToData(byte[] data)
public static byte[] concatAllArrays(byte[] data1,
byte[]... remaining)
public static byte[] leIntToBA(int value)
public static byte[] leShortToByteArray(short value)
public static int leBAToBeInt(byte[] data)
public static int leBAToBeShort(byte[] data)
public static byte[] rangeOfByteArray(byte[] data,
int offset,
int length)
public static String byteArrayToHex(byte[] b)
public static byte[] hexToByteArray(String hex) throws YubiHSMInputException
YubiHSMInputExceptionpublic static byte[] validateNonce(byte[] nonce,
boolean padding)
throws YubiHSMInputException
YubiHSMInputExceptionpublic static String validateString(String name, String data, int maxLength, int exactLength) throws YubiHSMInputException
YubiHSMInputExceptionpublic static byte[] validateByteArray(String name, byte[] data, int maxLength, int exactLength, int paddingLength) throws YubiHSMInputException
YubiHSMInputExceptionpublic static String validateCmdResponseString(String name, String got, String expected) throws YubiHSMErrorException
YubiHSMErrorExceptionpublic static byte[] validateCmdResponseBA(String name, byte[] got, byte[] expected) throws YubiHSMErrorException
YubiHSMErrorExceptionpublic static byte[] longToByteArray(long value)
public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2011-2016 United ID. All Rights Reserved.