IAIK PKCS#11 Wrapper
version 1.5

iaik.pkcs.pkcs11
Class State

java.lang.Object
  |
  +--iaik.pkcs.pkcs11.State
All Implemented Interfaces:
java.lang.Cloneable

public class State
extends java.lang.Object
implements java.lang.Cloneable

Objects of this class show the state of a session. This state is only a snapshot of the session's state at the time this state object was created.

Version:
1.0
Author:
Karl Scheibelhofer

Field Summary
protected  long code_
          The status code of this state as defined in PKCS#11.
static State RO_PUBLIC_SESSION
          Constant for a read-only public session.
static State RO_USER_FUNCTIONS
          Constant for a read-only user session.
static State RW_PUBLIC_SESSION
          Constant for a read-write public session.
static State RW_SO_FUNCTIONS
          Constant for a read-write security officer session.
static State RW_USER_FUNCTIONS
          Constant for a read-write user session.
 
Constructor Summary
protected State(long code)
          Constructor that simply takes the status code as defined in PKCS#11.
 
Method Summary
 java.lang.Object clone()
          Create a (deep) clone of this object.
 boolean equals(java.lang.Object otherObject)
          Compares the state code of this object with the other object.
 int hashCode()
          The overriding of this method should ensure that the objects of this class work correctly in a hashtable.
 java.lang.String toString()
          Returns the string representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RO_PUBLIC_SESSION

public static final State RO_PUBLIC_SESSION
Constant for a read-only public session.

RO_USER_FUNCTIONS

public static final State RO_USER_FUNCTIONS
Constant for a read-only user session.

RW_PUBLIC_SESSION

public static final State RW_PUBLIC_SESSION
Constant for a read-write public session.

RW_USER_FUNCTIONS

public static final State RW_USER_FUNCTIONS
Constant for a read-write user session.

RW_SO_FUNCTIONS

public static final State RW_SO_FUNCTIONS
Constant for a read-write security officer session.

code_

protected long code_
The status code of this state as defined in PKCS#11.
Constructor Detail

State

protected State(long code)
Constructor that simply takes the status code as defined in PKCS#11.
Parameters:
code - One of: PKCS11Constants.CKS_RO_PUBLIC_SESSION, PKCS11Constants.CKS_RO_USER_FUNCTIONS, PKCS11Constants.CKS_RW_PUBLIC_SESSION, PKCS11Constants.CKS_RW_USER_FUNCTIONS or PKCS11Constants.CKS_RW_SO_FUNCTIONS.
Method Detail

clone

public java.lang.Object clone()
Create a (deep) clone of this object.
Overrides:
clone in class java.lang.Object
Returns:
A clone of this object.

equals

public boolean equals(java.lang.Object otherObject)
Compares the state code of this object with the other object. Returns only true, if those are equal in both objects.
Overrides:
equals in class java.lang.Object
Parameters:
otherObject - The other State object.
Returns:
True, if other is an instance of State and the state code of both objects are equal. False, otherwise.

hashCode

public int hashCode()
The overriding of this method should ensure that the objects of this class work correctly in a hashtable.
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code of this object. Gained from the state code.

toString

public java.lang.String toString()
Returns the string representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
The string representation of object

IAIK PKCS#11 Wrapper
version 1.5

IAIK JavaSecurity Website http://jce.iaik.tugraz.at/

IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2004, IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved.
version 1.5