|
IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdemo.cms.envelopedData.EnvelopedDataOutputStreamDemo
public class EnvelopedDataOutputStreamDemo
Demonstrates the usage of class EnvelopedDataOutputStream and
for encrypting data using the CMS type EnvelopedData.
| Constructor Summary | |
|---|---|
EnvelopedDataOutputStreamDemo()
Setup the demo certificate chains. |
|
| Method Summary | |
|---|---|
byte[] |
createEnvelopedDataStream(byte[] message)
Creates a CMS EnvelopedData and wraps it into a ContentInfo. |
byte[] |
getEnvelopedDataStream(byte[] encoding,
java.security.PrivateKey privateKey,
int recipientInfoIndex)
Decrypts the encrypted content of the given EnvelopedData object for the specified recipient and returns the decrypted (= original) message. |
static void |
main(java.lang.String[] argv)
Main method. |
void |
start()
Starts the demo. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EnvelopedDataOutputStreamDemo()
throws java.io.IOException
java.io.IOException - if an file read error occurs| Method Detail |
|---|
public byte[] createEnvelopedDataStream(byte[] message)
throws iaik.cms.CMSException,
java.io.IOException
EnvelopedData and wraps it into a ContentInfo.
message - the message to be enveloped, as byte representation
iaik.cms.CMSException - if the EnvelopedData object cannot
be created
java.io.IOException - if an I/O error occurs
public byte[] getEnvelopedDataStream(byte[] encoding,
java.security.PrivateKey privateKey,
int recipientInfoIndex)
throws iaik.cms.CMSException,
java.io.IOException
encoding - the encoded EnvelopedData object, wrapped in a ContentInfoprivateKey - the private key to decrypt the messagerecipientInfoIndex - the index into the RecipientInfo array
to which the specified private key belongs
iaik.cms.CMSException - if the message cannot be recovered
java.io.IOException - if an I/O error occurspublic void start()
public static void main(java.lang.String[] argv)
throws java.lang.Exception
java.lang.Exception - if an some error occurs
|
IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
|
v6.1 (c) 2002 IAIK, (c) 2003 - 2025 SIC |
|