public class LunaUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Map<Long,Long> |
CKM2CKK_MAP |
| Constructor and Description |
|---|
LunaUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
FixDESParity(byte[] keyValue)
FixDESParity
This method will correct parity on a DES key.
|
static byte[] |
getEncodedDigest(byte[] b,
int off,
int len,
String digestAlg)
Generates an encoded ASN.1 digest of the given message, using the given digest algorithm.
|
static String |
getHexString(byte[] raw,
boolean addSpaces)
Turns a byte array into a human-readable hexademical string.
|
static byte[] |
hexStringToByteArray(String s) |
public static String getHexString(byte[] raw, boolean addSpaces)
raw - The byte array to transformaddSpaces - if true, adds a space after each hex couplet.
Sometimes this can increase readability.public static byte[] hexStringToByteArray(String s)
public static byte[] FixDESParity(byte[] keyValue)
keyValue - RAW bytes of the DES key to fixpublic static byte[] getEncodedDigest(byte[] b,
int off,
int len,
String digestAlg)
throws LunaException
b - The message to digestoff - Offset in the message array to begin digestinglen - Length of data to digestdigestAlg - The digest algorithm to useLunaException - exceptionCopyright 2014-2016 SafeNet Inc