public class Functions extends Object
| Constructor and Description |
|---|
Functions() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
asUnsignedByteArray(BigInteger bn) |
static byte[] |
decodeHex(String encoded) |
static String |
decodeOid(byte[] encoded) |
static byte[] |
dsaSigPlainToX962(byte[] sig) |
static byte[] |
dsaSigX962ToPlain(byte[] sig,
int rOrSLen) |
static byte[] |
encodeOid(String oid) |
static String |
getCurveName(byte[] ecParams) |
static String[] |
getCurveNames(byte[] ecParams) |
static Integer |
getCurveOrderBitLength(byte[] ecParams) |
static byte[] |
getEcParams(BigInteger order,
BigInteger baseX) |
static byte[] |
getOctetsFromASN1BitString(byte[] encoded) |
static byte[] |
getOctetsFromASN1OctetString(byte[] encoded) |
static Long |
parseLong(String text) |
static int |
requireAmong(String name,
int argument,
int... candidates) |
static <T> T |
requireNonNull(String paramName,
T param) |
static int |
requireRange(String name,
int argument,
int min,
int max) |
static String |
toFullHex(long value)
Converts a long value to a lower-case hexadecimal String of length 16.
|
static String |
toFullHexUpper(long value)
Converts a long value to an upper-case hexadecimal String of length 16.
|
static String |
toHex(byte[] value)
Converts a byte array to a hexadecimal String.
|
static String |
toHex(byte[] value,
int ofs,
int len) |
static byte[] |
toOctetOrBitString(byte[] bytes,
boolean isBitString) |
static String |
toString(String prefix,
byte[] bytes) |
static String |
toStringFlags(PKCS11Constants.Category category,
String prefix,
long flags,
long... flagMasks) |
public static byte[] encodeOid(String oid)
public static byte[] asUnsignedByteArray(BigInteger bn)
public static String toFullHex(long value)
value - The long value to be converted.public static String toFullHexUpper(long value)
value - The long value to be converted.public static String toHex(byte[] value)
value - the byte array to be convertedpublic static String toHex(byte[] value, int ofs, int len)
public static byte[] decodeHex(String encoded)
public static <T> T requireNonNull(String paramName, T param)
public static int requireRange(String name, int argument, int min, int max)
public static int requireAmong(String name, int argument, int... candidates)
public static String toStringFlags(PKCS11Constants.Category category, String prefix, long flags, long... flagMasks)
public static byte[] getEcParams(BigInteger order, BigInteger baseX)
public static Integer getCurveOrderBitLength(byte[] ecParams)
public static String getCurveName(byte[] ecParams)
public static String[] getCurveNames(byte[] ecParams)
public static String decodeOid(byte[] encoded)
public static byte[] dsaSigPlainToX962(byte[] sig)
public static byte[] dsaSigX962ToPlain(byte[] sig,
int rOrSLen)
public static byte[] getOctetsFromASN1OctetString(byte[] encoded)
throws TokenException
TokenExceptionpublic static byte[] getOctetsFromASN1BitString(byte[] encoded)
throws TokenException
TokenExceptionpublic static byte[] toOctetOrBitString(byte[] bytes,
boolean isBitString)
Copyright © 2023. All rights reserved.