Class Session

java.lang.Object
  |
  +--Session

public class Session
extends java.lang.Object

Logical conection between the token and the application.


Constructor Summary
Session()
           
 
Method Summary
 void cancelFunction()
          A legacy function which return a legacy error code that define thare is no function executing in parallel in the specified session.
 void closeAllSession()
          Close all sessions an application has with a token.
 void closeSession()
          Close a session between an application and a token.
 OoctiObject copyObject(OoctiObject object)
          Copies an object, creating a new object for the copy.
 OoctiObject createObject(Template object)
          Create a new object.
 char decrypt(char encryptedData)
          Decrypts a encrypted data in a single part.
 char decryptDigestUpdate(char encryptedPartData)
          Continues a multiple-part combine decryption and digest operation, processing another data part.
 void decryptFinal()
          Finishes a multiple-part decryption operation.
 void decryptInit(Mechanism mechanism, Key key)
          Initializes a decryption operation.
 char decryptUpdate(char encryptedPartData)
          Continues a multiple-part decryption operation, processing another encrypted data part.
 char decryptVerifyUpdate(char encryptedPartData)
          Continues a multiple-part combined decryption and verification operation, processing another data part.
 Key deriveKey(Mechanism mechanism, Key baseKey, Template template)
          Derive a key from a bese key, creating a new key object.
 void destroyObject(OoctiObject object)
          Destroy an object.
 char digest(char data)
          Digests data in a single part.
 char digestEncryptUpdate(char partData)
          Continues multiple-part digest and encryption operations, processing another data part.
 void digestFinal()
          Finishes a multiple-part message-digesting operation, returning the message digest.
 void digestInit(Mechanism mechanism)
          Initializes a message-digesting operation.
 void digestKey(SecretKey key)
          Continues a multiple-part message-digestion by digesting the value of a secret key.
 char digestUpdate(char partData)
          Continues a multiple-part message-digesting operation, processing another data part.
 char encrypt(char data)
          Encrypts single-part data.
 void encryptFinal()
          Finishes a multiple-part encryption operation.
 void encryptInit(Mechanism mechanism, Key key)
          Initialize an encryption operation.
 char encryptUpdate(char partData)
          Continues a multiple-part encryption operation, processing another data part.
 OoctiObject[] findObjects()
          Search for token and session objects that match a template.
 void findObjectsFinal()
          Terminates a search for token and session object.
 void findObjectsInit(Template match)
          Initializes a search for token and session object that match a template.
 Key generateKey(Mechanism mechanism, Template template)
          Generate a secret key, creating a new key object.
 Key[] generateKeyPair(Mechanism mechanism, Template publicKey, Template privateKey)
          Generate a public/private key pair, creating new key objects.
 char generateRandom()
          Generates random or pseudo-random data.
 void getFunctionStatus()
          A legacy function which return a legacy error code that define thare is no function executing in parallel in the specified session.
 java.lang.String[] getOperationState()
          Obtain a copy of the cryptographic operations state of a session, encoded as a string of byte.
 java.lang.String[] getSessionInfo()
          Obtain information about the session.
 void seedRandom(char seed)
          Mixes additional seed material into the token's random number generator.
 void setOperationState(java.lang.String operationState, Key encryptionKey, Key authenticationKey)
          Restore the cryptographic operations state of a session from a string of byte obtained with getOperationState.
 char sign(char data)
          Sings data in a single part, where the signature is an appendix to the data.
 char signEncryptUpdate(char partData)
          Continues a multiple-part combined signature and encryption operation, processing another data part.
 void signFinal()
          Finishes a multiple-part signature operation, returning the signature.
 void signInit(Mechanism mechanism, Key key)
          Initialize a signature operation, where the signature is an appendix to the data.
 char signRecover(char data)
          Signs data in a single operation, where the data can be recovered from the signature.
 void signRecoverInit(Mechanism mechanism, Key key)
          Initializes a signature operation, where the data can be recovered from the signature.
 char signUpdate(char partData)
          Continue a multiple-part signature operation, processing another data part.
 Key unwrapKey(Mechanism mechanism, Key unwrappingKey, Key wrappedKey, Template template)
          Unwraps a wrapped key, creating a new private key or secret key.
 char verify(char data)
          Verifies a signature in a single-part operation.
 void verifyFinal()
          Finishes a multiple-part verification operation, checking the signature.
 void verifyInit(Mechanism mechanism, Key key)
          Initialize a verification operation, where the signature is an appendix to the data.
 char verifyRecover(char signatureData)
          Verifies a signature in a single-part operation, where the data is recovered from the signature.
 void verifyRecoverInit(Mechanism mechanism, Key key)
          Initialize a signature verification operation, where the data is recovered from the signature.
 char verifyUpdate(char partData)
          Continue a multiple-part verification operation, processing another data part.
 Key wrapKey(Mechanism mechanism, Key wrappingKey, Key key)
          Wrap a private or secret key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session()
Method Detail

getSessionInfo

public java.lang.String[] getSessionInfo()
                                  throws OoctiException
Obtain information about the session.

encryptInit

public void encryptInit(Mechanism mechanism,
                        Key key)
                 throws OoctiException
Initialize an encryption operation.

encrypt

public char encrypt(char data)
             throws OoctiException
Encrypts single-part data. The encryption operation must have been initialize with encrypInit.

encryptUpdate

public char encryptUpdate(char partData)
                   throws OoctiException
Continues a multiple-part encryption operation, processing another data part.

encryptFinal

public void encryptFinal()
                  throws OoctiException
Finishes a multiple-part encryption operation.

decryptInit

public void decryptInit(Mechanism mechanism,
                        Key key)
                 throws OoctiException
Initializes a decryption operation.

decrypt

public char decrypt(char encryptedData)
             throws OoctiException
Decrypts a encrypted data in a single part.

decryptUpdate

public char decryptUpdate(char encryptedPartData)
                   throws OoctiException
Continues a multiple-part decryption operation, processing another encrypted data part.

decryptFinal

public void decryptFinal()
                  throws OoctiException
Finishes a multiple-part decryption operation.

digestInit

public void digestInit(Mechanism mechanism)
                throws OoctiException
Initializes a message-digesting operation.

digest

public char digest(char data)
            throws OoctiException
Digests data in a single part.

digestUpdate

public char digestUpdate(char partData)
                  throws OoctiException
Continues a multiple-part message-digesting operation, processing another data part.

digestKey

public void digestKey(SecretKey key)
               throws OoctiException
Continues a multiple-part message-digestion by digesting the value of a secret key.

digestFinal

public void digestFinal()
                 throws OoctiException
Finishes a multiple-part message-digesting operation, returning the message digest.

signInit

public void signInit(Mechanism mechanism,
                     Key key)
              throws OoctiException
Initialize a signature operation, where the signature is an appendix to the data.

sign

public char sign(char data)
          throws OoctiException
Sings data in a single part, where the signature is an appendix to the data.

signUpdate

public char signUpdate(char partData)
                throws OoctiException
Continue a multiple-part signature operation, processing another data part.

signFinal

public void signFinal()
               throws OoctiException
Finishes a multiple-part signature operation, returning the signature.

signRecoverInit

public void signRecoverInit(Mechanism mechanism,
                            Key key)
                     throws OoctiException
Initializes a signature operation, where the data can be recovered from the signature.

signRecover

public char signRecover(char data)
                 throws OoctiException
Signs data in a single operation, where the data can be recovered from the signature.

verifyInit

public void verifyInit(Mechanism mechanism,
                       Key key)
                throws OoctiException
Initialize a verification operation, where the signature is an appendix to the data.

verify

public char verify(char data)
            throws OoctiException
Verifies a signature in a single-part operation.

verifyUpdate

public char verifyUpdate(char partData)
                  throws OoctiException
Continue a multiple-part verification operation, processing another data part.

verifyFinal

public void verifyFinal()
                 throws OoctiException
Finishes a multiple-part verification operation, checking the signature.

verifyRecoverInit

public void verifyRecoverInit(Mechanism mechanism,
                              Key key)
                       throws OoctiException
Initialize a signature verification operation, where the data is recovered from the signature.

verifyRecover

public char verifyRecover(char signatureData)
                   throws OoctiException
Verifies a signature in a single-part operation, where the data is recovered from the signature.

digestEncryptUpdate

public char digestEncryptUpdate(char partData)
                         throws OoctiException
Continues multiple-part digest and encryption operations, processing another data part.

decryptDigestUpdate

public char decryptDigestUpdate(char encryptedPartData)
                         throws OoctiException
Continues a multiple-part combine decryption and digest operation, processing another data part.

signEncryptUpdate

public char signEncryptUpdate(char partData)
                       throws OoctiException
Continues a multiple-part combined signature and encryption operation, processing another data part.

decryptVerifyUpdate

public char decryptVerifyUpdate(char encryptedPartData)
                         throws OoctiException
Continues a multiple-part combined decryption and verification operation, processing another data part.

generateKey

public Key generateKey(Mechanism mechanism,
                       Template template)
                throws OoctiException
Generate a secret key, creating a new key object.

generateKeyPair

public Key[] generateKeyPair(Mechanism mechanism,
                             Template publicKey,
                             Template privateKey)
                      throws OoctiException
Generate a public/private key pair, creating new key objects.

wrapKey

public Key wrapKey(Mechanism mechanism,
                   Key wrappingKey,
                   Key key)
            throws OoctiException
Wrap a private or secret key.

unwrapKey

public Key unwrapKey(Mechanism mechanism,
                     Key unwrappingKey,
                     Key wrappedKey,
                     Template template)
              throws OoctiException
Unwraps a wrapped key, creating a new private key or secret key.

deriveKey

public Key deriveKey(Mechanism mechanism,
                     Key baseKey,
                     Template template)
              throws OoctiException
Derive a key from a bese key, creating a new key object.

seedRandom

public void seedRandom(char seed)
                throws OoctiException
Mixes additional seed material into the token's random number generator.

generateRandom

public char generateRandom()
                    throws OoctiException
Generates random or pseudo-random data.

cancelFunction

public void cancelFunction()
                    throws OoctiException
A legacy function which return a legacy error code that define thare is no function executing in parallel in the specified session.

getFunctionStatus

public void getFunctionStatus()
                       throws OoctiException
A legacy function which return a legacy error code that define thare is no function executing in parallel in the specified session.

copyObject

public OoctiObject copyObject(OoctiObject object)
                       throws OoctiException
Copies an object, creating a new object for the copy.

createObject

public OoctiObject createObject(Template object)
                         throws OoctiException
Create a new object. Only session object can be create during a read-only session. Only public objects can be created unless the normal user is logged in.

destroyObject

public void destroyObject(OoctiObject object)
                   throws OoctiException
Destroy an object. Only session object can be destroyed during a read-only session. Only public objects can be destroyed unless the normal user is logged in.

findObjectsInit

public void findObjectsInit(Template match)
                     throws OoctiException
Initializes a search for token and session object that match a template.

findObjects

public OoctiObject[] findObjects()
                          throws OoctiException
Search for token and session objects that match a template.

findObjectsFinal

public void findObjectsFinal()
                      throws OoctiException
Terminates a search for token and session object.

closeSession

public void closeSession()
                  throws OoctiException
Close a session between an application and a token.

closeAllSession

public void closeAllSession()
                     throws OoctiException
Close all sessions an application has with a token.

getOperationState

public java.lang.String[] getOperationState()
                                     throws OoctiException
Obtain a copy of the cryptographic operations state of a session, encoded as a string of byte.

setOperationState

public void setOperationState(java.lang.String operationState,
                              Key encryptionKey,
                              Key authenticationKey)
                       throws OoctiException
Restore the cryptographic operations state of a session from a string of byte obtained with getOperationState.