|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.crypto.KeyGeneratorSpi
Service Provider Interface (SPI) for the KeyGenerator class.
Attention: This is not a SUN implementation!
This class has been developed by IAIK according to the documentation publicly
available.
For SUNīs documentation of this class see
http://java.sun.com/security/JCE1.2/spec/apidoc/index.html
This SPI class gives a set of abstract methods that have to be implemented by a particular provider for every symmetric algorithm that will need some key generation mechanism for creating secret keys.
The corresponding API class actually used by an application for secret key
generation is the javax.crypto.KeyGenerator
class.
For creating a KeyGenerator object, an application shall use one of the
KeyGenerator.getInstance
method, supplied with the particular
symmetric algorithm in mind and (optionally) a particular provider.
For instance:
KeyGenerator key_gen = KeyGenerator.getInstance("DES");
For actually generating the requested secret key from the KeyGenerator object just
created (and initialized with one of the init
methods), use the
generateKey
method:
for instance: SecretKey des_key = key_gen.generateKey();
Initializing the key generator maybe done either algorithm-independently with some random seed, or algorithm-specific with some particular algorithm parameter specification. If no explicit initialization is done at all, it is left to the actual provider implementation to take default settings.
KeyGenerator
,
SecretKey
Constructor Summary | |
KeyGeneratorSpi()
Default Constructor for creating a KeyGeneratorSpi object. |
Method Summary | |
protected abstract SecretKey |
engineGenerateKey()
Actually generates a secret key from this KeyGenerator object. |
protected abstract void |
engineInit(AlgorithmParameterSpec params,
SecureRandom random)
Initializes this key generator with given algorithm parameters and random seed. |
protected abstract void |
engineInit(int strength,
SecureRandom random)
Initializes this key generator for the given strength with the given random seed |
protected abstract void |
engineInit(SecureRandom random)
Initializes the key generator with the given random seed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public KeyGeneratorSpi()
Method Detail |
protected abstract void engineInit(SecureRandom random)
random
- the random seedKeyGenerator.init(java.security.SecureRandom)
protected abstract void engineInit(int strength, SecureRandom random)
strength
- the strength of the key to be createdrandom
- the random seedprotected abstract void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
params
- the algorithm parametersrandom
- the random seedInvalidAlgorithmParameterException
- if the given algorithm parameters do not match to this KeyGeneratorKeyGenerator.init(java.security.SecureRandom)
protected abstract SecretKey engineGenerateKey()
KeyGenerator.generateKey()
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |