|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dstc.security.cms.CMSCipher
A class for encrypting (enveloping) data according to the CMS specification and for decrypting data generated according to that specification.
Constructor Summary | |
CMSCipher()
Default constructor |
Method Summary | |
DecryptionResult |
decrypt()
Decrypts the previously supplied CMS enveloped data and returns a DecryptionResult instance from which the recovered plaintext data can be read. |
CMSTypedDataInputStream |
encrypt()
Encrypts the previously supplied data and returns a CMSTypedDataInputStream
from which the CMS enveloped data can be read. |
void |
initDecrypt(PrivateKey priv,
X509Certificate cert)
Initializes for decryption of one or more instances of CMS enveloped data with a recipient's private key and associated certificate. |
void |
initEncrypt(SecureRandom rand,
X509Certificate[] rcptCerts,
String cipherAlg)
Initializes for encryption of one or more pieces of data with a random number generator together with the content encryption algorithm and a list of recipient certificates. |
void |
setDataToBeDecrypted(InputStream is)
Supplies the CMS enveloped data to be decrypted in the form of an InputStream. |
void |
setDataToBeEncrypted(CMSTypedDataInputStream is)
Supplies the data to be encrypted (turned into CMS enveloped data) in the form of a CMSTypedDataInputStream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public CMSCipher()
Method Detail |
public void initEncrypt(SecureRandom rand, X509Certificate[] rcptCerts, String cipherAlg) throws CMSException
DESede
, RC2
or RC2/40
.public void initDecrypt(PrivateKey priv, X509Certificate cert) throws CMSException
public void setDataToBeEncrypted(CMSTypedDataInputStream is) throws CMSException
sign()
on a CMSSignature
),
thereby allowing arbitrary nesting of CMS data.public void setDataToBeDecrypted(InputStream is) throws CMSException
No checks are performed on the supplied InputStream at this point.
public CMSTypedDataInputStream encrypt() throws CMSException, IOException
CMSTypedDataInputStream
from which the CMS enveloped data can be read.
A call to this method resets the state to when
initEncrypt()
was last called.
public DecryptionResult decrypt() throws CMSException, IOException
A call to this method resets the state to when initDecrypt() was last called.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |