|
Message Security Layer (MSL) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.msl.crypto.CryptoCache
public class CryptoCache
The crypto context cache provides a thread-local cache of cipher and signature objects.
Field Summary | |
---|---|
private static ThreadLocal<Map<String,Cipher>> |
cipherCache
Cache of transforms onto ciphers. |
private static ThreadLocal<Map<String,MessageDigest>> |
digestCache
Cache of algorithms onto message digests. |
private static ThreadLocal<Map<String,KeyAgreement>> |
keyAgreementCache
Cache of algorithms onto key agreements. |
private static ThreadLocal<Map<String,KeyFactory>> |
keyFactoryCache
Cache of algorithms onto key factories. |
private static ThreadLocal<Map<String,KeyPairGenerator>> |
keyPairGeneratorCache
Cache of algorithms onto key pair generators. |
private static ThreadLocal<Map<String,Mac>> |
macCache
Cache of algorithms onto MACs. |
private static ThreadLocal<Map<String,Signature>> |
signatureCache
Cache of algorithms onto signatures. |
Constructor Summary | |
---|---|
CryptoCache()
|
Method Summary | |
---|---|
static Cipher |
getCipher(String transform)
Returns a Cipher object that implements the specified transform. |
static KeyAgreement |
getKeyAgreement(String algorithm)
Returns a KeyAgreement object that implements the specified
algorithm. |
static KeyFactory |
getKeyFactory(String algorithm)
Returns a KeyFactory object that implements the specified
algorithm. |
static KeyPairGenerator |
getKeyPairGenerator(String algorithm)
Returns a KeyPairGenerator object that implements the specified
algorithm. |
static Mac |
getMac(String algorithm)
Returns a Mac object that implements the specified algorithm. |
static MessageDigest |
getMessageDigest(String algorithm)
Returns a MessageDigest object that implements the specified
algorithm. |
static Signature |
getSignature(String algorithm)
Returns a Signature object that implements the specified
algorithm. |
static void |
resetCipher(String transform)
Resets the Cipher object that implements the specified transform. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static ThreadLocal<Map<String,Cipher>> cipherCache
private static ThreadLocal<Map<String,Signature>> signatureCache
private static ThreadLocal<Map<String,MessageDigest>> digestCache
private static ThreadLocal<Map<String,Mac>> macCache
private static ThreadLocal<Map<String,KeyFactory>> keyFactoryCache
private static ThreadLocal<Map<String,KeyAgreement>> keyAgreementCache
private static ThreadLocal<Map<String,KeyPairGenerator>> keyPairGeneratorCache
Constructor Detail |
---|
public CryptoCache()
Method Detail |
---|
public static Cipher getCipher(String transform) throws NoSuchAlgorithmException, NoSuchPaddingException
Cipher
object that implements the specified transform.
transform
- encrypt/decrypt transform.
NoSuchAlgorithmException
- if transformation is null, empty, in an
invalid format, or if no Provider supports a CipherSpi
implementation for the specified algorithm.
NoSuchPaddingException
- if transformation contains a padding
scheme that is not available.resetCipher(String)
public static void resetCipher(String transform)
Cipher
object that implements the specified transform.
This method must be called if the cipher throws an exception to ensure
a clean cipher is returned from the next call to
getCipher(String)
.
transform
- encrypt/decrypt transform.getCipher(String)
public static Signature getSignature(String algorithm) throws NoSuchAlgorithmException
Signature
object that implements the specified
algorithm.
algorithm
- the sign/verify algorithm.
NoSuchAlgorithmException
- if no Provider supports a Signature
implementation for the specified algorithm.public static MessageDigest getMessageDigest(String algorithm) throws NoSuchAlgorithmException
MessageDigest
object that implements the specified
algorithm.
algorithm
- the digest algorithm.
NoSuchAlgorithmException
- if no Provider supports a MessageDigest
implementation for the specified algorithm.public static Mac getMac(String algorithm) throws NoSuchAlgorithmException
Mac
object that implements the specified algorithm.
algorithm
- the MAC algorithm.
NoSuchAlgorithmException
- if no Provider supports a Mac
implementation for the specified algorithm.public static KeyFactory getKeyFactory(String algorithm) throws NoSuchAlgorithmException
KeyFactory
object that implements the specified
algorithm.
algorithm
- the key factory algorithm.
NoSuchAlgorithmException
- if no Provider supports a KeyFactory
implementation for the specified algorithm.public static KeyAgreement getKeyAgreement(String algorithm) throws NoSuchAlgorithmException
KeyAgreement
object that implements the specified
algorithm.
algorithm
- the key agreement algorithm.
NoSuchAlgorithmException
- if no Provider supports a KeyAgreement
implementation for the specified algorithm.public static KeyPairGenerator getKeyPairGenerator(String algorithm) throws NoSuchAlgorithmException
KeyPairGenerator
object that implements the specified
algorithm.
algorithm
- the key pair generator algorithm.
NoSuchAlgorithmException
- if no Provider supports a
KeyPairGenerator implementation for the specified algorithm.
|
Message Security Layer (MSL) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |