|
XCMS Toolkit | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cms.crypto.CipherAlgorithmFactory
public class CipherAlgorithmFactory
Resolves a value of type ASN.1 OBJECT IDENTIFIER
into a Cipher Algorithm Cipher object.
Note that only CXER and DER encoding rules are currently supported.
| Field Summary | |
|---|---|
static byte[] |
DEFAULT_AES_CBC_IV
|
static byte[] |
DEFAULT_DESede_CBC_IV
|
static java.lang.String |
DEFAULT_XER_AES_CBC_IV
|
static java.lang.String |
DEFAULT_XER_DESede_CBC_IV
|
| Method Summary | |
|---|---|
javax.crypto.Cipher |
createForDecryption(java.security.PrivateKey key,
KeyEncryptionAlgorithmIdentifier algorithm)
Return a Cipher object that is ready for encryption |
javax.crypto.Cipher |
createForDecryption(javax.crypto.SecretKey key,
ContentEncryptionAlgorithmIdentifier algorithm)
Return a Cipher object that is ready for decryption. |
javax.crypto.Cipher |
createForDecryption(javax.crypto.SecretKey key,
KeyEncryptionAlgorithmIdentifier algorithm)
Creates a cipher for use in a decryption transform. |
javax.crypto.Cipher |
createForEncryption(java.security.PublicKey key,
KeyEncryptionAlgorithmIdentifier algorithm)
Return a Cipher object ready for encryption. |
javax.crypto.Cipher |
createForEncryption(javax.crypto.SecretKey key,
ContentEncryptionAlgorithmIdentifier algorithm)
Returns a Cipher object ready for encryption. |
javax.crypto.Cipher |
createForEncryption(javax.crypto.SecretKey key,
KeyEncryptionAlgorithmIdentifier algorithm)
Creates a cipher for use in an encryption transform. |
static CipherAlgorithmFactory |
getInstance(Codec codec)
Create a Cipher algorithm factory object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_XER_AES_CBC_IV
public static final java.lang.String DEFAULT_XER_DESede_CBC_IV
public static final byte[] DEFAULT_AES_CBC_IV
public static final byte[] DEFAULT_DESede_CBC_IV
| Method Detail |
|---|
public static CipherAlgorithmFactory getInstance(Codec codec)
throws CryptoException
codec - ASN.1 encoding rules
CryptoException
public javax.crypto.Cipher createForEncryption(javax.crypto.SecretKey key,
ContentEncryptionAlgorithmIdentifier algorithm)
throws CryptoException,
EncodingException,
java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException
Cipher object ready for encryption.
key - the secret key that will be used by the cipheralgorithm - a value of ASN.1 type
ContentEncryptionAlgorithmIdentifier
whose algorithm and associated parameters will be used
to encrypt data
null or a Cipher algorithm object that is ready for encryption
DecodingException
EncodingException
java.security.InvalidAlgorithmParameterException
java.security.InvalidKeyException
java.io.IOException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
CryptoException
public javax.crypto.Cipher createForEncryption(java.security.PublicKey key,
KeyEncryptionAlgorithmIdentifier algorithm)
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException,
java.io.IOException
key - a Key Encryption Key (KEK)algorithm - a value of ASN.1 type KeyEncryptionAlgorithmIdentifier
whose algorithm, a key encryption algorithm, will be used
to encrypt a key using the KEK
null or a Cipher algorithm object that is ready for encryption
DecodingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
java.io.IOException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
public javax.crypto.Cipher createForDecryption(javax.crypto.SecretKey key,
ContentEncryptionAlgorithmIdentifier algorithm)
throws java.security.NoSuchAlgorithmException,
EncodingException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException,
java.io.IOException,
CryptoException
key - a symmetric Content Encryption Key (KEK)algorithm - a value of ASN.1 type ContentEncryptionAlgorithmIdentifier
that will be used to decrypt ciphertext to recover the encrypted plaintext
- Returns:
- a Cipher algorithm object ready for decryption
- Throws:
DecodingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
java.io.IOException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
EncodingException
CryptoException
public javax.crypto.Cipher createForDecryption(java.security.PrivateKey key,
KeyEncryptionAlgorithmIdentifier algorithm)
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException,
java.io.IOException
key - a private asymmetric Key Encryption Key (KEK)algorithm - a value of ASN.1 type
KeyEncryptionAlgorithmIdentifier
that will be used to encrypt a Content Encryption Key (CEK)
null or a Cipher algorithm object that is ready for encryption
DecodingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
java.io.IOException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
public javax.crypto.Cipher createForEncryption(javax.crypto.SecretKey key,
KeyEncryptionAlgorithmIdentifier algorithm)
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException,
java.io.IOException,
CryptoException
key - algorithm -
null or a Cipher algorithm object that is ready for encryption
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
java.io.IOException
CryptoException
public javax.crypto.Cipher createForDecryption(javax.crypto.SecretKey key,
KeyEncryptionAlgorithmIdentifier algorithm)
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException,
java.io.IOException,
CryptoException
key - algorithm -
null or a Cipher algorithm object that is ready for encryption
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
java.io.IOException
CryptoException
|
XCMS Toolkit | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||