|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CipherEngine
Generic Cipher engine. Used by EncryptedContentInfoStream
and EncryptedContentInfo
for content en/decryption.
Setups a Cipher for encryption/decryption depending
on the requested mode. Allows the implementation of en/deciphering
utilities that may be independent from the JCE javax.crypto.Cipher
engine. The default implementation, however, is based on the
javax.crypto.Cipher
engine.
An application may not immediately implement this interface. Rather it may
implement on of the extending interfaces InputStreamCipherEngine
or ByteArrayCipherEngine
.
ByteArrayCipherEngine
,
InputStreamCipherEngine
,
SecurityProvider
Field Summary | |
---|---|
static int |
CIPHER_DECRYPT
Constant for a cipher object which is to be initialized for decryption. |
static int |
CIPHER_ENCRYPT
Constant for a cipher object which is to be initialized for encryption. |
static int |
CIPHER_NONE
Constant for a cipher engine which is not to be initialized. |
static int |
CIPHER_UNWRAP
Constant for a cipher object which is to be initialized for decryption. |
static int |
CIPHER_WRAP
Constant for a cipher object which is to be initialized for key wrap. |
Method Summary | |
---|---|
java.security.AlgorithmParameters |
getParameters()
Gets any parameters generated by this CipherEngine after initialization. |
void |
initCipher(AlgorithmID algorithm,
int mode,
java.security.Key key,
java.security.AlgorithmParameters params)
Inits this CipherEngine. |
void |
initCipher(AlgorithmID algorithm,
int mode,
java.security.Key key,
java.security.spec.AlgorithmParameterSpec paramSpec)
Inits this CipherEngine. |
void |
setSecurityProvider(SecurityProvider securityProvider)
Sets the SecurityProvider for this CipherEngine. |
Field Detail |
---|
static final int CIPHER_NONE
static final int CIPHER_ENCRYPT
static final int CIPHER_DECRYPT
static final int CIPHER_WRAP
static final int CIPHER_UNWRAP
Method Detail |
---|
void setSecurityProvider(SecurityProvider securityProvider)
securityProvider
- the SecurityProvider to be setvoid initCipher(AlgorithmID algorithm, int mode, java.security.Key key, java.security.AlgorithmParameters params) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
algorithm
- the cipher algorithm to be usedmode
- the cipher mode to be used (CIPHER_NONE, CIPHER_ENCRYPT, CIPHER_DECRYPT, CIPHER_WRAP, or CIPHER_UNWRAP)key
- the key to be used for en/decipheringparams
- any algorithm parameters required by the cipher algorithm
java.security.NoSuchAlgorithmException
- if the requested cipher algorithm is not supported
java.security.InvalidKeyException
- if there is a key related problem
java.security.InvalidAlgorithmParameterException
- if the parameters are not valid for the requested algorithmvoid initCipher(AlgorithmID algorithm, int mode, java.security.Key key, java.security.spec.AlgorithmParameterSpec paramSpec) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
algorithm
- the cipher algorithm to be usedmode
- the cipher mode to be used (CIPHER_NONE, CIPHER_ENCRYPT, CIPHER_DECRYPT, CIPHER_WRAP, or CIPHER_UNWRAP)key
- the key to be used for en/decipheringparamSpec
- any algorithm parameters required by the cipher algorithm
java.security.NoSuchAlgorithmException
- if the requested cipher algorithm is not supported
java.security.InvalidKeyException
- if there is a key related problem
java.security.InvalidAlgorithmParameterException
- if the parameters are not valid for the requested algorithmjava.security.AlgorithmParameters getParameters()
null
if no parameters are generated/used
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |