IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.pkcs.pkcs11.provider.spec
Class PKCS11Spec

java.lang.Object
  extended by iaik.pkcs.pkcs11.provider.spec.PKCS11Spec
All Implemented Interfaces:
java.security.spec.KeySpec
Direct Known Subclasses:
PKCS11KeyAgreementSpec, PKCS11KeyGenerationSpec, PKCS11KeyPairGenerationSpec, PKCS11KeySpec, PKCS11OAEPParameterSpec, PKCS11UnwrapKeySpec

public abstract class PKCS11Spec
extends java.lang.Object
implements java.security.spec.KeySpec

This is a key specification object. It carries the actual key spec and additional data needed for PKCS#11.


Field Summary
static boolean USE_PUBLIC_SESSION
          Deprecated.  
static boolean USE_READ_ONLY_SESSION
          Deprecated.  
static boolean USE_READ_WRITE_SESSION
          Deprecated.  
static boolean USE_USER_SESSION
          Deprecated.  
 
Constructor Summary
PKCS11Spec()
           
PKCS11Spec(TokenManager tokenManager, boolean useROSession, boolean useUserSession)
          Deprecated.  
 
Method Summary
 char[] getPin()
          Gets the pin.
 TokenManager getTokenManager()
          Get the manager to handle the token.
 boolean isUseAnonymousRole()
          Checks if the task should use an anonymous session.
 boolean isUseROSession()
          Check if the key should be generated using a read-only session.
 boolean isUseRwSession()
          Checks if the task should use a rw session.
 boolean isUseSORole()
          Checks if the task should use a Security Officer (SO) session.
 boolean isUseUserRole()
          Checks if the task should use a user session.
 boolean isUseUserSession()
          Check if the key should be generated using a user session.
 PKCS11Spec setPin(char[] pin)
          Allows to preset the required pin for User and SO session types.
 PKCS11Spec setTokenManager(TokenManager tokenManager)
          When there are multiple PKCS11-tokens in use, use this method to specify which TokenManager should be used.
 PKCS11Spec setUseAnonymousRole(boolean rwAccess)
          Use an anonymous (aka public) session when performing the task.
 PKCS11Spec setUseSORole()
          Use a Security Officer (SO) session when performing the task.
 PKCS11Spec setUseUserRole(boolean rwAccess)
          Use a user session when performing the task.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_READ_ONLY_SESSION

public static boolean USE_READ_ONLY_SESSION
Deprecated. 
Constant for the useROSession_ property. Tells that a read-only session shall be used.


USE_READ_WRITE_SESSION

public static boolean USE_READ_WRITE_SESSION
Deprecated. 
Constant for the useROSession_ property. Tells that a read-write session shall be used.


USE_USER_SESSION

public static boolean USE_USER_SESSION
Deprecated. 
Constant for the useUserSession_ property. Tells that an user session shall be used.


USE_PUBLIC_SESSION

public static boolean USE_PUBLIC_SESSION
Deprecated. 
Constant for the useUserSession_ property. Tells that a public session shall be used.

Constructor Detail

PKCS11Spec

public PKCS11Spec(TokenManager tokenManager,
                  boolean useROSession,
                  boolean useUserSession)
Deprecated. 

Constructor taking several parameters that control where and how the key should be generated.

Parameters:
tokenManager - The manager to handle the token to generate the key on.
useROSession - true (USE_READ_ONLY_SESSION), if the key should be generated using a read-only session. This is only possible for session-objects. false ( USE_READ_WRITE_SESSION) to use a read-write session.
useUserSession - true (USE_USER_SESSION), if the key should be generated using a user session. This is required for private objects (key); i.e. keys that have their private flag set. false (USE_PUBLIC_SESSION) to use a public session. This will only work for public objects.

PKCS11Spec

public PKCS11Spec()
Method Detail

setTokenManager

public PKCS11Spec setTokenManager(TokenManager tokenManager)
When there are multiple PKCS11-tokens in use, use this method to specify which TokenManager should be used.

Parameters:
tokenManager - the new token manager

getTokenManager

public TokenManager getTokenManager()
Get the manager to handle the token.

Returns:
The manager to handle the token.
Postconditions
(result <> null)

isUseROSession

public boolean isUseROSession()
Check if the key should be generated using a read-only session. This is only possible for session-objects.

Returns:
true, if the key should be generated using a read-only session. false to use a read-write session.

isUseUserSession

public boolean isUseUserSession()
Check if the key should be generated using a user session. This is required for private objects (key); i.e. keys that have their private flag set.

Returns:
true (USE_USER_SESSION), if the key should be generated using a user session. false ( USE_PUBLIC_SESSION) to use a public session.

setUseAnonymousRole

public PKCS11Spec setUseAnonymousRole(boolean rwAccess)
Use an anonymous (aka public) session when performing the task.

Parameters:
rwAccess - whether or not rw access should be used.
Returns:
this (PKCS11Spec)

setUseUserRole

public PKCS11Spec setUseUserRole(boolean rwAccess)
Use a user session when performing the task.

Parameters:
rwAccess - whether or not rw access should be used.
Returns:
this (PKCS11Spec)

setUseSORole

public PKCS11Spec setUseSORole()
Use a Security Officer (SO) session when performing the task. A rw session will be used.

Returns:
this (PKCS11Spec)

isUseAnonymousRole

public boolean isUseAnonymousRole()
Checks if the task should use an anonymous session.

Returns:
true, if yes

isUseUserRole

public boolean isUseUserRole()
Checks if the task should use a user session.

Returns:
true, if yes

isUseSORole

public boolean isUseSORole()
Checks if the task should use a Security Officer (SO) session.

Returns:
true, if yes

isUseRwSession

public boolean isUseRwSession()
Checks if the task should use a rw session.

Returns:
true, if rw; false, if ro

setPin

public PKCS11Spec setPin(char[] pin)
Allows to preset the required pin for User and SO session types.

Parameters:
pin - the pin
Returns:
this (PKCS11Spec)

getPin

public char[] getPin()
Gets the pin.

Returns:
the pin. null if no pin is given.

IAIK PKCS#11 Provider API Documentation
version 1.6

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.6