public class MyKeyPairGenerator1 extends KeyPairGenerator
Modifier and Type | Class and Description |
---|---|
class |
MyKeyPairGenerator1.PrivKey |
class |
MyKeyPairGenerator1.PubKey |
Modifier and Type | Field and Description |
---|---|
int |
keySize |
AlgorithmParameterSpec |
paramSpec |
SecureRandom |
secureRandom |
Constructor and Description |
---|
MyKeyPairGenerator1() |
MyKeyPairGenerator1(String pp) |
Modifier and Type | Method and Description |
---|---|
KeyPair |
generateKeyPair()
Computes and returns a new unique
KeyPair each time this method
is called. |
String |
getAlgorithm()
Returns the name of the algorithm of this
KeyPairGenerator . |
static String |
getResAlgorithm() |
void |
initialize(AlgorithmParameterSpec param,
SecureRandom random)
Initializes this
KeyPairGenerator with the given AlgorithmParameterSpec and the given SecureRandom . |
void |
initialize(int keysize,
SecureRandom random)
Initializes this
KeyPairGenerator with the given key size and the
given SecureRandom . |
genKeyPair, getInstance, getInstance, getInstance, getProvider, initialize, initialize
public int keySize
public SecureRandom secureRandom
public AlgorithmParameterSpec paramSpec
public MyKeyPairGenerator1()
public MyKeyPairGenerator1(String pp)
public String getAlgorithm()
KeyPairGenerator
KeyPairGenerator
.getAlgorithm
in class KeyPairGenerator
KeyPairGenerator
public static final String getResAlgorithm()
public void initialize(int keysize, SecureRandom random)
KeyPairGenerator
KeyPairGenerator
with the given key size and the
given SecureRandom
. The default parameter set will be used.initialize
in class KeyPairGenerator
keysize
- the key sizerandom
- the source of randomnesspublic KeyPair generateKeyPair()
KeyPairGenerator
KeyPair
each time this method
is called.
This does exactly the same as KeyPairGenerator.genKeyPair()
.
generateKeyPair
in class KeyPairGenerator
KeyPair
each time this method is calledpublic void initialize(AlgorithmParameterSpec param, SecureRandom random) throws InvalidAlgorithmParameterException
KeyPairGenerator
KeyPairGenerator
with the given AlgorithmParameterSpec
and the given SecureRandom
.initialize
in class KeyPairGenerator
param
- the parameters to userandom
- the source of randomnessInvalidAlgorithmParameterException
- if the specified parameters are not supported