|
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.PasswordRecipientInfoDemo
public class PasswordRecipientInfoDemo
This class shows the usage of the CMS RecipientInfo type PasswordRecipientInfo
as specified by RFC 5652.
Constructor Summary | |
---|---|
PasswordRecipientInfoDemo()
Default constructor. |
Method Summary | |
---|---|
byte[] |
createEnvelopedData(byte[] message,
char[] password,
iaik.asn1.structures.AlgorithmID keyDerivationAlg,
java.security.spec.AlgorithmParameterSpec keyDerivatoinParamSpec,
iaik.asn1.structures.AlgorithmID keyEncrAlg,
java.security.AlgorithmParameters keyEncrParams)
Creates a CMS EnvelopedData with a PasswordRecipientInfo
and wraps it into a ContentInfo. |
byte[] |
createEnvelopedDataStream(byte[] message,
char[] password,
iaik.asn1.structures.AlgorithmID keyDerivationAlg,
java.security.spec.AlgorithmParameterSpec keyDerivatoinParamSpec,
iaik.asn1.structures.AlgorithmID keyEncrAlg,
java.security.AlgorithmParameters keyEncrParams)
Creates a CMS EnvelopedData with a PasswordRecipientInfo
and wraps it into a ContentInfo (stream implementation). |
byte[] |
getEnvelopedData(byte[] encoding,
char[] password,
java.lang.String cekAlgName)
PBE based decrypts the encrypted content of the given EnvelopedData object and returns the decrypted (= original) message. |
byte[] |
getEnvelopedDataStream(byte[] encoding,
char[] password,
java.lang.String cekAlgName)
PBE based decrypts the encrypted content of the given EnvelopedData object and returns the decrypted (= original) message (stream implementation). |
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 PasswordRecipientInfoDemo()
Method Detail |
---|
public byte[] createEnvelopedDataStream(byte[] message, char[] password, iaik.asn1.structures.AlgorithmID keyDerivationAlg, java.security.spec.AlgorithmParameterSpec keyDerivatoinParamSpec, iaik.asn1.structures.AlgorithmID keyEncrAlg, java.security.AlgorithmParameters keyEncrParams) throws iaik.cms.CMSException, java.io.IOException
EnvelopedData
with a PasswordRecipientInfo
and wraps it into a ContentInfo (stream implementation).
message
- the message to be enveloped, as byte representationpassword
- the password from which to derive the key encryption key (kek)keyDerivationAlg
- the key derivation function to be used for deriving the kekkeyDerivatoinParamSpec
- any parameters required by the key derivation functionkeyEncrAlg
- the ID of the key-encryption (key-wrap) algorithm to be used
for encrypting the content-encryption keykeyEncrParams
- any algorithm parameters to be used for intializing the
key wrap cipher
iaik.cms.CMSException
- if the EnvelopedData
object cannot
be created
java.io.IOException
- if an I/O error occurspublic byte[] getEnvelopedDataStream(byte[] encoding, char[] password, java.lang.String cekAlgName) throws iaik.cms.CMSException, java.io.IOException
encoding
- the encoded ContentInfo containing an EnvelopedData objectpassword
- the password from which to derive the key-encryption key (kek)
to be used for decrypting the content-encryption key (cek)cekAlgName
- the name of the cek (content encryption key) algorithm
iaik.cms.CMSException
- if the message cannot be recovered
java.io.IOException
- if an I/O error occurspublic byte[] createEnvelopedData(byte[] message, char[] password, iaik.asn1.structures.AlgorithmID keyDerivationAlg, java.security.spec.AlgorithmParameterSpec keyDerivatoinParamSpec, iaik.asn1.structures.AlgorithmID keyEncrAlg, java.security.AlgorithmParameters keyEncrParams) throws iaik.cms.CMSException
EnvelopedData
with a PasswordRecipientInfo
and wraps it into a ContentInfo.
message
- the message to be enveloped, as byte representationpassword
- the password from which to derive the key encryption key (kek)keyDerivationAlg
- the key derivation function to be used for deriving the kekkeyDerivatoinParamSpec
- any parameters required by the key derivation functionkeyEncrAlg
- the ID of the key-encryption (key-wrap) algorithm to be used
for encrypting the content-encryption keykeyEncrParams
- any algorithm parameters to be used for intializing the
key wrap cipher
iaik.cms.CMSException
- if the EnvelopedData
object cannot
be createdpublic byte[] getEnvelopedData(byte[] encoding, char[] password, java.lang.String cekAlgName) throws iaik.cms.CMSException, java.io.IOException
encoding
- the encoded ContentInfo containing an EnvelopedData objectpassword
- the password from which to derive the key-encryption key (kek)
to be used for decrypting the content-encryption key (cek)cekAlgName
- the name of the cek (content encryption key) algorithm
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 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 |
![]() |