org.mozilla.jss.pkcs11
public final class PK11KeyPairGenerator extends KeyPairGeneratorSpi
See Also: PQGParams
Field Summary | |
---|---|
static PQGParams | PQG1024
Pre-cooked PQG values for 1024-bit keypairs, along with the seed,
counter, and H values needed to verify them. |
static PQGParams | PQG512
Pre-cooked PQG values for 512-bit keypairs, along with the seed,
counter, and H values needed to verify them. |
static PQGParams | PQG768
Pre-cooked PQG values for 768-bit keypairs, along with the seed,
counter, and H values needed to verify them. |
Constructor Summary | |
---|---|
PK11KeyPairGenerator(PK11Token token, KeyPairAlgorithm algorithm)
Constructor for PK11KeyPairGenerator. |
Method Summary | |
---|---|
void | extractablePairs(boolean extractable) |
KeyPair | generateKeyPair()
Generates a key pair on a token. |
void | initialize(int strength, SecureRandom random)
Initializes this KeyPairGenerator with the given key strength.
|
void | initialize(AlgorithmParameterSpec params, SecureRandom random)
Initializes this KeyPairGenerator with the given algorithm-specific
parameters.
|
boolean | keygenOnInternalToken() |
void | sensitivePairs(boolean sensitive) |
void | setKeyPairUsages(KeyPairGeneratorSpi.Usage[] usages, KeyPairGeneratorSpi.Usage[] usages_mask)
Sets the requested key usages desired for the
generated key pair.
|
void | temporaryPairs(boolean temp) |
Parameters: token The PKCS #11 token that the keypair will be generated on. algorithm The type of key that will be generated. Currently,
KeyPairAlgorithm.RSA
,
KeyPairAlgorithm.DSA
and
KeyPairAlgorithm.EC
are supported.
initialize
, otherwise uses defaults.For DSA key generation, pre-cooked PQG values will be used be used if the key size is 512, 768, or 1024. Otherwise, an InvalidParameterException will be thrown.
Parameters: strength The strength (size) of the keys that will be generated. random Ignored
Throws: InvalidParameterException If the key strength is not supported by the algorithm or this implementation.
Parameters: params The algorithm-specific parameters that will govern key pair generation. random Ignored
Throws: InvalidAlgorithmParameterException If the parameters are inappropriate for the key type or are not supported by this implementation.
Returns: true if the keypair generation will be done on the internal token and then moved to this token.
Parameters: usages List of desired key usages. usages_mask Corresponding mask for the key usages. if a usages is desired, make sure it is in the mask as well.