public class AESEnvelopedDataDemo extends EnvelopedDataDemo
EnvelopedDataStream
and
EnvelopedData
for encrypting data using the CMS type
EnvelopedData with the AES cipher algorithm.
This demo creates an EnvelopedData object and subsequently shows several ways that may be used for decrypting the content for some particular recipient.
Keys and certificates are retrieved from the demo KeyStore ("cms.keystore")
which has to be located in your current working directory and may be
created by running the SetupCMSKeyStore
program.
EnvelopedDataStream
,
EnvelopedData
,
RecipientInfo
,
KeyTransRecipientInfo
,
KeyAgreeRecipientInfo
,
KEKRecipientInfo
Constructor and Description |
---|
AESEnvelopedDataDemo()
Creates an AESEnvelopedDataDemo and setups the demo certificates.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] argv)
Main method.
|
createEnvelopedData, createEnvelopedDataStream, createRecipients, getEnvelopedData, getEnvelopedData, getEnvelopedData, getEnvelopedDataStream, getEnvelopedDataStream, getEnvelopedDataStream, parseEnvelopedDataWithRecipientCertOrKEKId, parseEnvelopedDataWithRecipientIdentifier, parseEnvelopedDataWithRecipientInfoIndex, start
public AESEnvelopedDataDemo() throws java.io.IOException, java.security.NoSuchAlgorithmException
SetupCMSKeyStore
.
java.io.IOException
- if an file read error occursjava.security.NoSuchAlgorithmException
- if the requested algorithms are not supportedpublic static void main(java.lang.String[] argv) throws java.lang.Exception
java.io.IOException
- if an I/O error occurs when reading required keys
and certificates from filesjava.lang.Exception