|
IAIK PKCS#11 Wrapper version 1.2.16 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiaik.pkcs.pkcs11.Util
A class consisting of static methods only which provide certain static piecec of code that are used frequently in this project.
Constructor Summary | |
Util()
|
Method Summary | |
static CK_ATTRIBUTE[] |
convertAttributesVectorToArray(Vector attributes)
Converts the given vector into an array of CK_ATTRIBUTE elements. |
static CK_DATE |
convertToCkDate(Date date)
Convert the given Date object to a CK_DATE object. |
static Date |
convertToDate(CK_DATE ckDate)
Convert the given CK_DATE object to a Date object. |
static Date |
parseTime(char[] timeChars)
Parse a time character array as defined in PKCS#11 and return is as a Date object. |
static char[] |
toCharArray(int number,
int exactArrayLength)
Converts the given number into a char-array. |
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. a 1024 bit integer with its highest bit set will result in an 128 byte array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Util()
Method Detail |
public static Date parseTime(char[] timeChars)
timeChars
- A time encoded as character array as specified in PKCS#11.
public static Date convertToDate(CK_DATE ckDate)
ckDate
- The object providing the date information.
public static 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 retirned char-array.paddingChar
- The character to use for padding, if necessary.
public static byte[] unsignedBigIntergerToByteArray(BigInteger bigInteger)
bigInteger
- The BigInteger to convert.
public static CK_ATTRIBUTE[] convertAttributesVectorToArray(Vector attributes)
attributes
- The vector which contains the attributes.
|
IAIK PKCS#11 Wrapper version 1.2.16 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |