public class

Functions

extends Object
java.lang.Object
   ↳ sun.security.pkcs11.wrapper.Functions

Class Overview

This class contains onyl static methods. It is the place for all functions that are used by several classes in this package.

Summary

Public Constructors
Functions()
Public Methods
static boolean equals(char[] array1, char[] array2)
Check the given arrays for equalitiy.
static boolean equals(byte[] array1, byte[] array2)
Check the given arrays for equalitiy.
static boolean equals(CK_DATE date1, CK_DATE date2)
Check the given dates for equalitiy.
static long getAttributeId(String name)
static String getAttributeName(long id)
static long getId(Map<StringInteger> idMap, String name)
static long getKeyId(String name)
static String getKeyName(long id)
static long getMechanismId(String name)
static String getMechanismName(long id)
static long getObjectClassId(String name)
static String getObjectClassName(long id)
static int hashCode(CK_DATE date)
Calculate a hash code for the given date object.@preconditions
static int hashCode(char[] array)
Calculate a hash code for the given char array.@preconditions
static int hashCode(byte[] array)
Calculate a hash code for the given byte array.@preconditions
static String mechanismInfoFlagsToString(long flags)
converts the long value flags to a MechanismInfoFlag string
static String sessionInfoFlagsToString(long flags)
converts the long value flags to a SessionInfoFlag string
static String sessionStateToString(long state)
converts the long value state to a SessionState string
static String slotInfoFlagsToString(long flags)
converts the long value flags to a SlotInfoFlag string
static String toBinaryString(byte[] value)
converts a byte array to a binary String
static String toBinaryString(long value)
converts a long value to a binary String
static String toFullHexString(long value)
Converts a long value to a hexadecimal String of length 16.
static String toFullHexString(int value)
Converts a int value to a hexadecimal String of length 8.
static String toHexString(long value)
converts a long value to a hexadecimal String
static String toHexString(byte[] value)
Converts a byte array to a hexadecimal String.
static String tokenInfoFlagsToString(long flags)
converts long value flags to a TokenInfoFlag string
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Functions ()

Public Methods

public static boolean equals (char[] array1, char[] array2)

Check the given arrays for equalitiy. This method considers both arrays as equal, if both are null or both have the same length and contain exactly the same char values.@preconditions

Parameters
array1 The first array.
array2 The second array.
Returns
  • True, if both arrays are null or both have the same length and contain exactly the same char values. False, otherwise.

public static boolean equals (byte[] array1, byte[] array2)

Check the given arrays for equalitiy. This method considers both arrays as equal, if both are null or both have the same length and contain exactly the same byte values.@preconditions

Parameters
array1 The first array.
array2 The second array.
Returns
  • True, if both arrays are 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)

Check the given dates for equalitiy. This method considers both dates as equal, if both are null or both contain exactly the same char values.@preconditions

Parameters
date1 The first date.
date2 The second date.
Returns
  • True, if both dates are null or both contain the same char values. False, otherwise.

public static long getAttributeId (String name)

public static String getAttributeName (long id)

public static long getId (Map<StringInteger> idMap, String name)

public static long getKeyId (String name)

public static String getKeyName (long id)

public static long getMechanismId (String name)

public static String getMechanismName (long id)

public static long getObjectClassId (String name)

public static String getObjectClassName (long id)

public static int hashCode (CK_DATE date)

Calculate a hash code for the given date object.@preconditions

Parameters
date The date object.
Returns
  • A hash code for the given date.

public static int hashCode (char[] array)

Calculate a hash code for the given char array.@preconditions

Parameters
array The char array.
Returns
  • A hash code for the given array.

public static int hashCode (byte[] array)

Calculate a hash code for the given byte array.@preconditions

Parameters
array The byte array.
Returns
  • A hash code for the given array.

public static String mechanismInfoFlagsToString (long flags)

converts the long value flags to a MechanismInfoFlag string

Parameters
flags the flags to be converted
Returns
  • the MechanismInfoFlag string representation of the flags

public static String sessionInfoFlagsToString (long flags)

converts the long value flags to a SessionInfoFlag string

Parameters
flags the flags to be converted
Returns
  • the SessionInfoFlag string representation of the flags

public static String sessionStateToString (long state)

converts the long value state to a SessionState string

Parameters
state the state to be converted
Returns
  • the SessionState string representation of the state

public static String slotInfoFlagsToString (long flags)

converts the long value flags to a SlotInfoFlag string

Parameters
flags the flags to be converted
Returns
  • the SlotInfoFlag string representation of the flags

public static String toBinaryString (byte[] value)

converts a byte array to a binary String

Parameters
value the byte array to be converted
Returns
  • the binary string representation of the byte array

public static String toBinaryString (long value)

converts a long value to a binary String

Parameters
value the long value to be converted
Returns
  • the binary string representation of the long value

public static String toFullHexString (long value)

Converts a long value to a hexadecimal String of length 16. Includes leading zeros if necessary.

Parameters
value The long value to be converted.
Returns
  • The hexadecimal string representation of the long value.

public static String toFullHexString (int value)

Converts a int value to a hexadecimal String of length 8. Includes leading zeros if necessary.

Parameters
value The int value to be converted.
Returns
  • The hexadecimal string representation of the int value.

public static String toHexString (long value)

converts a long value to a hexadecimal String

Parameters
value the long value to be converted
Returns
  • the hexadecimal string representation of the long value

public static String toHexString (byte[] value)

Converts a byte array to a hexadecimal String. Each byte is presented by its two digit hex-code; 0x0A -> "0a", 0x00 -> "00". No leading "0x" is included in the result.

Parameters
value the byte array to be converted
Returns
  • the hexadecimal string representation of the byte array

public static String tokenInfoFlagsToString (long flags)

converts long value flags to a TokenInfoFlag string

Parameters
flags the flags to be converted
Returns
  • the TokenInfoFlag string representation of the flags