Package org.globus.gsi.gssapi
Class KeyPairCache
java.lang.Object
org.globus.gsi.gssapi.KeyPairCache
Simple cache for key pairs. The cache is used to avoid excessive
CPU consumption from key pair generation. In particular for
purposes of delegation, reusing a key pair is safe.
- Author:
- Gerd Behrmann (behrmann@ndgf.org)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetKeyPair
(int bits) Returns a key pair of sizebits
.static KeyPairCache
static KeyPairCache
getKeyPairCache
(String algorithm, String provider, long lifetime)
-
Field Details
-
DEFAULT_ALGORITHM
- See Also:
-
DEFAULT_PROVIDER
- See Also:
-
-
Method Details
-
getKeyPairCache
-
getKeyPairCache
-
getKeyPair
Returns a key pair of sizebits
. 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.- Parameters:
bits
- the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.- Throws:
NoSuchAlgorithmException
- if the algorithm is not available in the environment.NoSuchProviderException
- if the provider is not available in the environment.
-