|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.jss.crypto.KeyPairGenerator
KeyPairGenerator
)
public class 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)
Field Summary | |
---|---|
protected KeyPairAlgorithm |
algorithm
Deprecated. |
protected KeyPairGeneratorSpi |
engine
Deprecated. |
Constructor Summary | |
---|---|
KeyPairGenerator(KeyPairAlgorithm algorithm,
KeyPairGeneratorSpi engine)
Deprecated. Creates a new key pair generator. |
Method Summary | |
---|---|
void |
extractablePairs(boolean extractable)
Deprecated. Tells the generator to generate extractable or unextractable keypairs. |
java.security.KeyPair |
genKeyPair()
Deprecated. Generates a new key pair. |
KeyPairAlgorithm |
getAlgorithm()
Deprecated. |
void |
initialize(java.security.spec.AlgorithmParameterSpec params)
Deprecated. Initializes the generator with algorithm-specific parameters. |
void |
initialize(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Deprecated. Initializes the generator with algorithm-specific parameters. |
void |
initialize(int strength)
Deprecated. Initializes the generator with the strength of the keys. |
void |
initialize(int strength,
java.security.SecureRandom random)
Deprecated. Initializes the generator with the strength of the keys. |
boolean |
keygenOnInternalToken()
Deprecated. |
void |
sensitivePairs(boolean sensitive)
Deprecated. Tells the generator to generate sensitive or insensitive keypairs. |
void |
setKeyPairUsages(KeyPairGeneratorSpi.Usage[] usages,
KeyPairGeneratorSpi.Usage[] usages_mask)
Deprecated. |
void |
temporaryPairs(boolean temp)
Deprecated. Tells the generator to generate temporary or permanent keypairs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected KeyPairAlgorithm algorithm
protected KeyPairGeneratorSpi engine
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
.
TokenException
- If an error occurs on the CryptoToken
in the process of generating the key pair.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. NSS does not accept
an external source of random numbers.
java.security.InvalidAlgorithmParameterException
- If the parameters are
inappropriate for the type of key pair that is being generated,
or they are not supported by this generator.RSAParameterSpec
,
DSAParameterSpec
public void initialize(java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidAlgorithmParameterException
params
- Algorithm-specific parameters for the key pair generation.
java.security.InvalidAlgorithmParameterException
- If the parameters are
inappropriate for the type of key pair that is being generated,
or they are not supported by this generator.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. NSS does not accept
an external source of random numbers.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)
temp
- public void sensitivePairs(boolean sensitive)
sensitive
- public void extractablePairs(boolean extractable)
extractable
- public void setKeyPairUsages(KeyPairGeneratorSpi.Usage[] usages, KeyPairGeneratorSpi.Usage[] usages_mask)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |