IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.pkcs.pkcs11.provider.keypairgenerators
Class PKCS11KeyPairGenerator

java.lang.Object
  extended by java.security.KeyPairGeneratorSpi
      extended by iaik.pkcs.pkcs11.provider.keypairgenerators.PKCS11KeyPairGenerator
All Implemented Interfaces:
PKCS11EngineClass
Direct Known Subclasses:
DhKeyPairGenerator, DsaKeyPairGenerator, EcDsaKeyPairGenerator, KeaKeyPairGenerator, RsaKeyPairGenerator, RsaX931KeyPairGenerator, X942DhKeyPairGenerator

public abstract class PKCS11KeyPairGenerator
extends java.security.KeyPairGeneratorSpi
implements PKCS11EngineClass

An abstract engine class for generating key-pairs on a token. The application must call initialize(AlgorithmParameterSpec, SecureRandom) before calling generateKeyPair().

Author:
Karl Scheibelhofer

Method Summary
 java.security.KeyPair generateKeyPair()
          Generate a new key pair.
 void initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
          Just throws an UnsupportedOperationException.
 void initialize(int keysize, java.security.SecureRandom random)
          Just throws an UnsupportedOperationException.
 boolean isSupportedBy(TokenManager tokenManager)
          Check, if the current token of the given token manager supports the required features for this engine class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isSupportedBy

public boolean isSupportedBy(TokenManager tokenManager)
Check, if the current token of the given token manager supports the required features for this engine class.

Specified by:
isSupportedBy in interface PKCS11EngineClass
Parameters:
tokenManager - The token manager. Used to get information about the current token.
Returns:
True, if this engine class can be used with the currently present token of the given token manager.
Preconditions
(tokenManager <> null)

initialize

public void initialize(int keysize,
                       java.security.SecureRandom random)
                throws java.security.InvalidParameterException
Just throws an UnsupportedOperationException. Use initialize(int, KCS11PublicKey, PKCS11PrivateKey) instead.

Specified by:
initialize in class java.security.KeyPairGeneratorSpi
Parameters:
keysize - The size of the keys in bits.
random - The source of randomness.
Throws:
java.security.InvalidParameterException - If the key-size is unsupported.

initialize

public void initialize(java.security.spec.AlgorithmParameterSpec params,
                       java.security.SecureRandom random)
                throws java.security.InvalidAlgorithmParameterException
Just throws an UnsupportedOperationException. Use initialize(int, KCS11PublicKey, PKCS11PrivateKey) instead.

Overrides:
initialize in class java.security.KeyPairGeneratorSpi
Parameters:
params - The algorithm parameters, which must be an instance of PKCS11KeyPairGenerationSpec and must not be null.
random - The source of randomness. This implementation ignores this parameter.
Throws:
java.security.InvalidAlgorithmParameterException - If the given parameters are invalid.
Preconditions
(params instanceof PKCS11KeyPairGenerationSpec)

generateKeyPair

public java.security.KeyPair generateKeyPair()
Generate a new key pair.

Specified by:
generateKeyPair in class java.security.KeyPairGeneratorSpi
Returns:
The newly generated key-pair.
Postconditions
(result <> null)

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