public class Functions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.util.Hashtable |
digestMechanisms_
This table contains the mechanisms that are digest mechanisms.
|
protected static java.util.Hashtable |
fullEncryptDecryptMechanisms_
This table contains the mechanisms that are full encrypt/decrypt mechanisms; i.e.
|
protected static java.util.Hashtable |
fullSignVerifyMechanisms_
This table contains the mechanisms that are full sign/verify mechanisms; i.e.
|
protected static char[] |
HEX_DIGITS
For converting numbers to their hex presentation.
|
protected static java.util.Hashtable |
keyDerivationMechanisms_
This table contains the mechanisms that are key derivation mechanisms.
|
protected static java.util.Hashtable |
keyGenerationMechanisms_
This table contains the mechanisms that key generation mechanisms; i.e.
|
protected static java.util.Hashtable |
keyPairGenerationMechanisms_
This table contains the mechanisms that key-pair generation mechanisms; i.e.
|
protected static java.util.Hashtable |
mechansimNames_
Maps mechanism codes as Long to their names as Strings.
|
protected static java.util.Hashtable |
signVerifyRecoverMechanisms_
This table contains the mechanisms that are sign/verify mechanisms with message recovery.
|
protected static java.util.Hashtable |
singleOperationEncryptDecryptMechanisms_
This table contains the mechanisms that are single-operation encrypt/decrypt mechanisms; i.e.
|
protected static java.util.Hashtable |
singleOperationSignVerifyMechanisms_
This table contains the mechanisms that are single-operation sign/verify mechanisms; i.e.
|
protected static java.util.Hashtable |
wrapUnwrapMechanisms_
This table contains the mechanisms that are wrap/unwrap mechanisms.
|
Constructor and Description |
---|
Functions() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
classTypeToString(long classType)
Converts the long value classType to a string representation of it.
|
static boolean |
equals(byte[] array1,
byte[] array2)
Check the given arrays for equalitiy.
|
static boolean |
equals(char[] array1,
char[] array2)
Check the given arrays for equalitiy.
|
static boolean |
equals(CK_DATE date1,
CK_DATE date2)
Check the given dates for equalitiy.
|
static boolean |
equals(long[] array1,
long[] array2)
Check the given arrays for equality.
|
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(CK_DATE date)
Calculate a hash code for the given date object.
|
static int |
hashCode(long[] array)
Calculate a hash code for the given long array.
|
static boolean |
isDigestMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a digest mechanism.
|
static boolean |
isFullEncryptDecryptMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a full encrypt/decrypt mechanism;
i.e.
|
static boolean |
isFullSignVerifyMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a full sign/verify mechanism; i.e.
|
static boolean |
isKeyDerivationMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a key derivation mechanism.
|
static boolean |
isKeyGenerationMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a key generation mechanism for
generating symmetric keys.
|
static boolean |
isKeyPairGenerationMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a key-pair generation mechanism for
generating key-pairs.
|
static boolean |
isSignVerifyRecoverMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a sign/verify mechanism with
message recovery.
|
static boolean |
isSingleOperationEncryptDecryptMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a single-operation encrypt/decrypt
mechanism; i.e.
|
static boolean |
isSingleOperationSignVerifyMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a single-operation sign/verify
mechanism; i.e.
|
static boolean |
isWrapUnwrapMechanism(long mechanismCode)
This method checks, if the mechanism with the given code is a wrap/unwrap mechanism; i.e.
|
static java.lang.String |
mechanismCodeToString(long mechansimCode)
Converts the long value code of a mechanism to a name.
|
static java.lang.String |
mechanismInfoFlagsToString(long flags)
Converts the long value flags to a MechanismInfoFlag string.
|
static java.lang.String |
sessionInfoFlagsToString(long flags)
Converts the long value flags to a SessionInfoFlag string.
|
static java.lang.String |
sessionStateToString(long state)
Converts the long value state to a SessionState string.
|
static java.lang.String |
slotInfoFlagsToString(long flags)
Converts the long value flags to a SlotInfoFlag string.
|
static java.lang.String |
toBinaryString(byte[] value)
Converts a byte array to a binary String.
|
static java.lang.String |
toBinaryString(long value)
Converts a long value to a binary String.
|
static java.lang.String |
toFullHexString(int value)
Converts a int value to a hexadecimal String of length 8.
|
static java.lang.String |
toFullHexString(long value)
Converts a long value to a hexadecimal String of length 16.
|
static java.lang.String |
toHexString(byte[] value)
Converts a byte array to a hexadecimal String.
|
static java.lang.String |
toHexString(long value)
Converts a long value to a hexadecimal String.
|
static java.lang.String |
tokenInfoFlagsToString(long flags)
Converts long value flags to a TokenInfoFlag string.
|
protected static java.util.Hashtable mechansimNames_
protected static java.util.Hashtable fullEncryptDecryptMechanisms_
protected static java.util.Hashtable singleOperationEncryptDecryptMechanisms_
protected static java.util.Hashtable fullSignVerifyMechanisms_
protected static java.util.Hashtable singleOperationSignVerifyMechanisms_
protected static java.util.Hashtable signVerifyRecoverMechanisms_
protected static java.util.Hashtable digestMechanisms_
protected static java.util.Hashtable keyGenerationMechanisms_
protected static java.util.Hashtable keyPairGenerationMechanisms_
protected static java.util.Hashtable wrapUnwrapMechanisms_
protected static java.util.Hashtable keyDerivationMechanisms_
protected static final char[] HEX_DIGITS
public static java.lang.String toFullHexString(long value)
value
- The long value to be converted.public static java.lang.String toFullHexString(int value)
value
- The int value to be converted.public static java.lang.String toHexString(long value)
value
- The long value to be converted.public static java.lang.String toHexString(byte[] value)
value
- the byte array to be convertedpublic static java.lang.String toBinaryString(long value)
value
- the long value to be converted.public static java.lang.String toBinaryString(byte[] value)
value
- The byte array to be converted.public static java.lang.String slotInfoFlagsToString(long flags)
flags
- The flags to be converted.public static java.lang.String tokenInfoFlagsToString(long flags)
flags
- The flags to be converted.public static java.lang.String sessionInfoFlagsToString(long flags)
flags
- The flags to be converted.public static java.lang.String sessionStateToString(long state)
state
- The state to be converted.public static java.lang.String mechanismInfoFlagsToString(long flags)
flags
- The flags to be converted to a string representation.public static java.lang.String mechanismCodeToString(long mechansimCode)
mechansimCode
- The code of the mechanism to be converted to a string.public static java.lang.String classTypeToString(long classType)
classType
- The classType to be converted.public static boolean equals(byte[] array1, byte[] array2)
null
or both have the same length and contain exactly the same byte values.array1
- The first array.array2
- The second array.null
or both have the same length and contain
exactly the same byte values. False, otherwise.public static boolean equals(char[] array1, char[] array2)
null
or both have the same length and contain exactly the same char values.array1
- The first array.array2
- The second array.null
or both have the same length and contain
exactly the same char values. False, otherwise.public static boolean equals(long[] array1, long[] array2)
null
or both have the same length and contain exactly the same byte values.array1
- The first array.array2
- The second array.null
or both have the same length and contain
exactly the same byte values. False, otherwise.public static boolean equals(CK_DATE date1, CK_DATE date2)
null
or both contain exactly the same char values.date1
- The first date.date2
- The second date.null
or both contain the same char values. False,
otherwise.public 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 int hashCode(CK_DATE date)
date
- The date object.public static boolean isFullEncryptDecryptMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.public static boolean isSingleOperationEncryptDecryptMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.public static boolean isFullSignVerifyMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.public static boolean isSingleOperationSignVerifyMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.public static boolean isSignVerifyRecoverMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.public static boolean isDigestMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.public static boolean isKeyGenerationMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.public static boolean isKeyPairGenerationMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.public static boolean isWrapUnwrapMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.public static boolean isKeyDerivationMechanism(long mechanismCode)
mechanismCode
- The code of the mechanism to check.IAIK JavaSecurity Website http://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2023 IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved. version 1.6.9