public class Util extends Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static String |
concat(String s1,
String... strs) |
static String |
concatObjects(Object o1,
Object... objs) |
static String |
concatObjectsCap(int cap,
Object o1,
Object... objs) |
static sun.security.pkcs11.wrapper.CK_ATTRIBUTE[] |
convertAttributesVectorToArray(Vector<sun.security.pkcs11.wrapper.CK_ATTRIBUTE> attributes)
Converts the given vector into an array of CK_ATTRIBUTE elements.
|
static sun.security.pkcs11.wrapper.CK_DATE |
convertToCkDate(Date date)
Convert the given Date object to a CK_DATE object.
|
static Date |
convertToDate(sun.security.pkcs11.wrapper.CK_DATE ckDate)
Convert the given CK_DATE object to a Date object.
|
static Constructor<?> |
getConstructor(Class<?> clazz,
Class<?>... parameterTypes) |
static Constructor<?> |
getConstructor(String className,
Class<?>... parameterTypes) |
static Field |
getField(Class<?> clazz,
String fieldName) |
static Method |
getMethod(Class<?> clazz,
String name,
Class<?>... parameterTypes) |
static int |
hashCode(byte[] array)
Calculate a hash code for the given byte array.
|
static int |
hashCode(char[] array)
Calculate a hash code for the given char array.
|
static int |
hashCode(long[] array)
Calculate a hash code for the given long array.
|
static boolean |
objEquals(Object obj1,
Object obj2) |
static Date |
parseTime(char[] timeChars)
Parse a time character array as defined in PKCS#11 and return is as a
Date object.
|
static <T> T |
requireNonNull(String paramName,
T param) |
static char[] |
toCharArray(int number,
int exactArrayLength)
Converts the given number into a char-array.
|
static String |
toHex(byte[] value)
Converts a byte array to a hexadecimal String.
|
static char[] |
toPaddedCharArray(String string,
int exactArrayLength,
char paddingChar)
Converts the given string to a char-array of exactly the given length.
|
static byte[] |
unsignedBigIntergerToByteArray(BigInteger bigInteger)
Convert a BigInteger to a byte-array, but treat the byte-array given from
the BigInteger as unsigned and removing any leading zero bytes; e.g.
|
public static <T> T requireNonNull(String paramName, T param)
public static Date parseTime(char[] timeChars)
timeChars - A time encoded as character array as specified in PKCS#11.public static Date convertToDate(sun.security.pkcs11.wrapper.CK_DATE ckDate)
ckDate - The object providing the date information.public static sun.security.pkcs11.wrapper.CK_DATE convertToCkDate(Date date)
date - The object providing the date information.public static char[] toCharArray(int number,
int exactArrayLength)
number - The number to convert to a char array.exactArrayLength - The exact length of the returned array.public static char[] toPaddedCharArray(String string, int exactArrayLength, char paddingChar)
string - The string to convert.exactArrayLength - The length of the returned char-array.paddingChar - The character to use for padding, if necessary.public static byte[] unsignedBigIntergerToByteArray(BigInteger bigInteger)
bigInteger - The BigInteger to convert.public static sun.security.pkcs11.wrapper.CK_ATTRIBUTE[] convertAttributesVectorToArray(Vector<sun.security.pkcs11.wrapper.CK_ATTRIBUTE> attributes)
attributes - The vector which contains the attributes.public static String toHex(byte[] value)
value - The byte array to be convertedpublic static int hashCode(byte[] array)
array - The byte array.public static int hashCode(char[] array)
array - The char array.public static int hashCode(long[] array)
array - The long array.public static Constructor<?> getConstructor(String className, Class<?>... parameterTypes)
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... parameterTypes)
Copyright © 2022. All rights reserved.