public final class DHKeyPairGenerator extends java.security.KeyPairGeneratorSpi implements AlgorithmStatus
This key pair generator may be initialized in two different ways:
KeyPairGenerator
Constructor and Description |
---|
DHKeyPairGenerator() |
Modifier and Type | Method and Description |
---|---|
java.security.KeyPair |
generateKeyPair()
Generates a key pair.
|
void |
initialize(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Initializes this key pair generator for the specified parameter
set and source of randomness.
|
void |
initialize(int keysize,
java.security.SecureRandom random)
Initializes this key pair generator for a certain keysize and source of
randomness.
|
boolean |
isFipsApproved()
This function allows an application to verify the the algorithm is
FIPS approved.
|
public void initialize(int keysize, java.security.SecureRandom random)
initialize
in class java.security.KeyPairGeneratorSpi
keysize
- the keysize (size of prime modulus) in bitsrandom
- the source of randomnesspublic boolean isFipsApproved()
isFipsApproved
in interface AlgorithmStatus
AlgorithmStatus.isFipsApproved()
public void initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException
The given parameter set contains the prime modulus, the base generator, and optionally the requested size in bits of the random exponent (private value).
initialize
in class java.security.KeyPairGeneratorSpi
params
- the parameter set used to generate the key pairrandom
- the source of randomnessjava.security.InvalidAlgorithmParameterException
- if the given parameters
are inappropriate for this key pair generatorpublic java.security.KeyPair generateKeyPair()
generateKeyPair
in class java.security.KeyPairGeneratorSpi
© Portions Copyright 2003, 2012 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2012, Oracle and/or its affiliates. All rights reserved.