|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.mozilla.jss.crypto.KeyPairGenerator
Generates RSA and DSA key pairs. Each CryptoToken provides a
KeyPairGenerator, which can be used to generate key pairs on that token.
A given token may not support all algorithms, and some tokens may not
support any key pair generation. If a token does not support key pair
generation, the Netscape internal token may do it instead. Call
keygenOnInternalToken to find out if this is happening.
CryptoToken.getKeyPairGenerator(org.mozilla.jss.crypto.KeyPairAlgorithm)| Constructor Summary | |
KeyPairGenerator(KeyPairAlgorithm algorithm,
KeyPairGeneratorSpi engine)
Creates a new key pair generator. |
|
| Method Summary | |
java.security.KeyPair |
genKeyPair()
Generates a new key pair. |
KeyPairAlgorithm |
getAlgorithm()
|
void |
initialize(java.security.spec.AlgorithmParameterSpec params)
Initializes the generator with algorithm-specific parameters. |
void |
initialize(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Initializes the generator with algorithm-specific parameters. |
void |
initialize(int strength)
Initializes the generator with the strength of the keys. |
void |
initialize(int strength,
java.security.SecureRandom random)
Initializes the generator with the strength of the keys. |
boolean |
keygenOnInternalToken()
|
void |
temporaryPairs(boolean temp)
Tells the generator to generate temporary, rather than permanent, keypairs. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public KeyPairGenerator(KeyPairAlgorithm algorithm,
KeyPairGeneratorSpi engine)
CryptoToken.getKeyPairGenerator
instead of calling this constructor.algorithm - The type of keys that the generator will be
used to generate.engine - The engine object that provides the implementation for
the class.| Method Detail |
public java.security.KeyPair genKeyPair()
throws TokenException
KeyPairGenerator.public KeyPairAlgorithm getAlgorithm()
public void initialize(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
throws java.security.InvalidAlgorithmParameterException
params - Algorithm-specific parameters for the key pair generation.random - This parameter is ignored.RSAParameterSpec,
DSAParameterSpec
public void initialize(java.security.spec.AlgorithmParameterSpec params)
throws java.security.InvalidAlgorithmParameterException
params - Algorithm-specific parameters for the key pair generation.RSAParameterSpec,
DSAParameterSpec
public void initialize(int strength,
java.security.SecureRandom random)
strength - The strength of the keys that will be generated.
Usually this is the length of the key in bits.random - This parameter is ignored.public void initialize(int strength)
strength - The strength of the keys that will be generated.
Usually this is the length of the key in bits.public boolean keygenOnInternalToken()
public void temporaryPairs(boolean temp)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||