public class KeyPairCache extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ALGORITHM |
static String |
DEFAULT_PROVIDER |
| Modifier and Type | Method and Description |
|---|---|
KeyPair |
getKeyPair(int bits)
Returns a key pair of size
bits. |
static KeyPairCache |
getKeyPairCache() |
static KeyPairCache |
getKeyPairCache(String algorithm,
String provider,
long lifetime) |
public static final String DEFAULT_ALGORITHM
public static final String DEFAULT_PROVIDER
public static KeyPairCache getKeyPairCache()
public static KeyPairCache getKeyPairCache(String algorithm, String provider, long lifetime)
public KeyPair getKeyPair(int bits) throws NoSuchAlgorithmException, NoSuchProviderException
bits. The same key pair
may be returned several times within a period of the cache
lifetime.
If lifetime was set to zero or less than zero, no keys are cached.bits - the keysize. This is an algorithm-specific metric,
such as modulus length, specified in number of bits.NoSuchAlgorithmException - if the algorithm is not
available in the environment.NoSuchProviderException - if the provider is not
available in the environment.Copyright © 2013. All Rights Reserved.