IAIK PKCS#11 Wrapper
version 1.2.17

iaik.pkcs.pkcs11
Class SessionInfo

java.lang.Object
  extended byiaik.pkcs.pkcs11.SessionInfo
All Implemented Interfaces:
Cloneable

public class SessionInfo
extends Object
implements Cloneable

An object of this class provides information about a session. The information provided is just a snapshot at the time this information object was created; it does not retrieve the information from the session on demand.

Invariants
(state_ <> null)

Field Summary
protected  long deviceError_
          An token specific error-code.
protected  boolean rwSession_
          True, if this is a read-write session.
protected  boolean serialSession_
          True, if this a serial session.
protected  long slotID_
          The identifier of the slot in which the token resides this session is bound to.
protected  State state_
          The current session state.
 
Constructor Summary
protected SessionInfo(CK_SESSION_INFO ckSessionInfo)
          Constructor taking a CK_SESSION_INFO object that provides the infromation.
 
Method Summary
 Object clone()
          Create a (deep) clone of this object.
 boolean equals(Object otherObject)
          Compares all member variables of this object with the other object.
 long getDeviceError()
          Get the current device error-code of the token.
 State getState()
          Get the current state of this session.
 int hashCode()
          The overriding of this method should ensure that the objects of this class work correctly in a hashtable.
 boolean isRwSession()
          Check, if this is a read-write session.
 boolean isSerialSession()
          Check, if this is a serial session.
 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

slotID_

protected long slotID_
The identifier of the slot in which the token resides this session is bound to.


state_

protected State state_
The current session state.


deviceError_

protected long deviceError_
An token specific error-code. The meaning of this value is not defined in PKCS#11.


rwSession_

protected boolean rwSession_
True, if this is a read-write session.


serialSession_

protected boolean serialSession_
True, if this a serial session. Always true, for this version of PKCS#11.

Constructor Detail

SessionInfo

protected SessionInfo(CK_SESSION_INFO ckSessionInfo)
Constructor taking a CK_SESSION_INFO object that provides the infromation.

Parameters:
ckSessionInfo - The object providing the session information.
Preconditions
(pkcs11Module <> null) and (ckSessionInfo <> null)
Postconditions
Method Detail

clone

public Object clone()
Create a (deep) clone of this object.

Returns:
A clone of this object.
Preconditions
Postconditions
(result <> null) and (result instanceof SessionInfo) and (result.equals(this))

getState

public State getState()
Get the current state of this session.

Returns:
The current state of this session.
Preconditions
Postconditions
(result <> null)

getDeviceError

public long getDeviceError()
Get the current device error-code of the token. Notice that this code is device-specific. Its meaning is not defined in the PKCS#11 standard.

Returns:
The error-code of the device.
Preconditions
Postconditions

isRwSession

public boolean isRwSession()
Check, if this is a read-write session.

Returns:
True, if this is a read-write session; false, if this is a read-only session.
Preconditions
Postconditions

isSerialSession

public boolean isSerialSession()
Check, if this is a serial session. Should always be true for version 2.x of the PKCS#11 standard.

Returns:
True, if this is a serial session; flase, if this is a parallel session. Should always be true for version 2.x of the PKCS#11 standard..
Preconditions
Postconditions

toString

public String toString()
Returns the string representation of this object.

Returns:
The string representation of object

equals

public boolean equals(Object otherObject)
Compares all member variables of this object with the other object. Returns only true, if all are equal in both objects.

Parameters:
otherObject - The other SessionInfo object.
Returns:
True, if other is an instance of Info and all member variables of both objects are equal. False, otherwise.
Preconditions
Postconditions

hashCode

public int hashCode()
The overriding of this method should ensure that the objects of this class work correctly in a hashtable.

Returns:
The hash code of this object. Gained from the slotID_, state_ and deviceError_.
Preconditions
Postconditions

IAIK PKCS#11 Wrapper
version 1.2.17

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

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