Methods Summary |
---|
public final java.security.KeyPair | genKeyPair()Computes and returns a new unique {@code KeyPair} each time this method
is called.
This does exactly the same as {@link #generateKeyPair()}.
return generateKeyPair();
|
public java.security.KeyPair | generateKeyPair()Computes and returns a new unique {@code KeyPair} each time this method
is called.
This does exactly the same as {@link #genKeyPair()}.
return null;
|
public java.lang.String | getAlgorithm()Returns the name of the algorithm of this {@code KeyPairGenerator}.
return algorithm;
|
public static java.security.KeyPairGenerator | getInstance(java.lang.String algorithm)Returns a new instance of {@code KeyPairGenerator} that utilizes the
specified algorithm.
if (algorithm == null) {
throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
}
KeyPairGenerator result;
synchronized (engine) {
engine.getInstance(algorithm, null);
if (engine.spi instanceof KeyPairGenerator) {
result = (KeyPairGenerator) engine.spi;
result.algorithm = algorithm;
result.provider = engine.provider;
return result;
} else {
result = new KeyPairGeneratorImpl((KeyPairGeneratorSpi) engine.spi,
engine.provider, algorithm);
return result;
}
}
|
public static java.security.KeyPairGenerator | getInstance(java.lang.String algorithm, java.lang.String provider)Returns a new instance of {@code KeyPairGenerator} that utilizes the
specified algorithm from the specified provider.
if ((provider == null) || (provider.length() == 0)) {
throw new IllegalArgumentException(
Messages.getString("security.02")); //$NON-NLS-1$
}
Provider impProvider = Security.getProvider(provider);
if (impProvider == null) {
throw new NoSuchProviderException(provider);
}
return getInstance(algorithm, impProvider);
|
public static java.security.KeyPairGenerator | getInstance(java.lang.String algorithm, java.security.Provider provider)Returns a new instance of {@code KeyPairGenerator} that utilizes the
specified algorithm from the specified provider.
if (provider == null) {
throw new IllegalArgumentException(Messages.getString("security.04")); //$NON-NLS-1$
}
if (algorithm == null) {
throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
}
KeyPairGenerator result;
synchronized (engine) {
engine.getInstance(algorithm, provider, null);
if (engine.spi instanceof KeyPairGenerator) {
result = (KeyPairGenerator) engine.spi;
result.algorithm = algorithm;
result.provider = provider;
return result;
} else {
result = new KeyPairGeneratorImpl((KeyPairGeneratorSpi) engine.spi,
provider, algorithm);
return result;
}
}
|
public final java.security.Provider | getProvider()Returns the provider associated with this {@code KeyPairGenerator}.
return provider;
|
public void | initialize(int keysize, java.security.SecureRandom random)Initializes this {@code KeyPairGenerator} with the given key size and the
given {@code SecureRandom}. The default parameter set will be used.
|
public void | initialize(java.security.spec.AlgorithmParameterSpec param, java.security.SecureRandom random)Initializes this {@code KeyPairGenerator} with the given {@code
AlgorithmParameterSpec} and the given {@code SecureRandom}.
|
public void | initialize(int keysize)Initializes this {@code KeyPairGenerator} with the given key size. The
default parameter set and a default {@code SecureRandom} instance will be
used.
initialize(keysize, random);
|
public void | initialize(java.security.spec.AlgorithmParameterSpec param)Initializes this {@code KeyPairGenerator} with the given {@code
AlgorithmParameterSpec}. A default {@code SecureRandom} instance will be
used.
initialize(param, random);
|