public class LunaUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.Map<java.lang.Long,java.lang.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,
java.lang.String digestAlg)
Generates an encoded ASN.1 digest of the given message, using the given digest algorithm.
|
static java.lang.String |
getHexString(byte[] raw,
boolean addSpaces)
Turns a byte array into a human-readable hexademical string.
|
static byte[] |
hexStringToByteArray(java.lang.String s) |
public static final java.util.Map<java.lang.Long,java.lang.Long> CKM2CKK_MAP
public static java.lang.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(java.lang.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,
java.lang.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-2018 SafeNet. All rights reserved.