public class PKCS7CMSEncryptedDataDemo extends java.lang.Object
Constructor and Description |
---|
PKCS7CMSEncryptedDataDemo()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
iaik.asn1.ASN1Object |
createEncryptedData(byte[] message,
iaik.asn1.structures.AlgorithmID pbeAlgorithm,
char[] password)
Creates a CMS
EncryptedData message. |
byte[] |
createEncryptedDataStream(byte[] message,
iaik.asn1.structures.AlgorithmID pbeAlgorithm,
char[] password)
Creates a CMS
EncryptedDataStream message. |
iaik.asn1.ASN1Object |
createPKCS7EncryptedData(byte[] message,
iaik.asn1.structures.AlgorithmID pbeAlgorithm,
char[] password)
Creates a PKCS#7
EncryptedData message. |
byte[] |
createPKCS7EncryptedDataStream(byte[] message,
iaik.asn1.structures.AlgorithmID pbeAlgorithm,
char[] password)
Creates a PKCS#7
EncryptedDataStream message. |
byte[] |
getEncryptedData(iaik.asn1.ASN1Object asn1Object,
char[] password)
Decrypts the PBE-encrypted content of the given CMS
EncryptedData object
using the specified password and returns the decrypted (= original) message. |
byte[] |
getEncryptedDataStream(byte[] encoding,
char[] password)
Decrypts the PBE-encrypted content of the given CMS
EncryptedData object
using the specified password and returns the decrypted (= original) message. |
byte[] |
getPKCS7EncryptedData(iaik.asn1.ASN1Object asn1Object,
char[] password)
Decrypts the PBE-encrypted content of the given PKCS#7
EncryptedData object
using the specified password and returns the decrypted (= original) message. |
byte[] |
getPKCS7EncryptedDataStream(byte[] encoding,
char[] password)
Decrypts the PBE-encrypted content of the given PKCS#7
EncryptedData object
using the specified password and returns the decrypted (= original) message. |
static void |
main(java.lang.String[] argv)
Tests the IAIK CMS against the IAIK PKCS#7 EncryptedData(Stream) implementation.
|
void |
start()
Starts the tests.
|
public PKCS7CMSEncryptedDataDemo()
public byte[] createEncryptedDataStream(byte[] message, iaik.asn1.structures.AlgorithmID pbeAlgorithm, char[] password) throws iaik.cms.CMSException, java.io.IOException
EncryptedDataStream
message.
The supplied content is PBE-encrypted using the specified password.
message
- the message to be encrypted, as byte representationpbeAlgorithm
- the PBE algorithm to be usedpassword
- the passwordEncryptedData
object just creatediaik.cms.CMSException
- if the EncryptedData
object cannot
be createdjava.io.IOException
- if an I/O error occurspublic byte[] getEncryptedDataStream(byte[] encoding, char[] password) throws iaik.cms.CMSException, java.io.IOException
EncryptedData
object
using the specified password and returns the decrypted (= original) message.encoding
- the EncryptedData
object as DER encoded byte arraypassword
- the password to decrypt the messageiaik.cms.CMSException
- if the message cannot be recoveredjava.io.IOException
- if an I/O error occurspublic iaik.asn1.ASN1Object createEncryptedData(byte[] message, iaik.asn1.structures.AlgorithmID pbeAlgorithm, char[] password) throws iaik.cms.CMSException, java.io.IOException
EncryptedData
message.
The supplied content is PBE-encrypted using the specified password.
message
- the message to be encrypted, as byte representationpbeAlgorithm
- the PBE algorithm to be usedpassword
- the passwordEncryptedData
object just creatediaik.cms.CMSException
- if the EncryptedData
object cannot
be createdjava.io.IOException
- if an I/O error occurspublic byte[] getEncryptedData(iaik.asn1.ASN1Object asn1Object, char[] password) throws iaik.cms.CMSException, java.io.IOException
EncryptedData
object
using the specified password and returns the decrypted (= original) message.asn1Object
- the EncryptedData
object as ASN1Objectpassword
- the password to decrypt the messageiaik.cms.CMSException
- if the message cannot be recoveredjava.io.IOException
- if an I/O error occurspublic byte[] createPKCS7EncryptedDataStream(byte[] message, iaik.asn1.structures.AlgorithmID pbeAlgorithm, char[] password) throws iaik.pkcs.PKCSException, java.io.IOException
EncryptedDataStream
message.
The supplied content is PBE-encrypted using the specified password.
message
- the message to be encrypted, as byte representationpbeAlgorithm
- the PBE algorithm to be usedpassword
- the passwordEncryptedData
object just creatediaik.pkcs.PKCSException
- if the EncryptedData
object cannot
be createdjava.io.IOException
- if an I/O error occurspublic byte[] getPKCS7EncryptedDataStream(byte[] encoding, char[] password) throws iaik.pkcs.PKCSException, java.io.IOException
EncryptedData
object
using the specified password and returns the decrypted (= original) message.encoding
- the EncryptedData
object as DER encoded byte arraypassword
- the password to decrypt the messageiaik.pkcs.PKCSException
- if the message cannot be recoveredjava.io.IOException
- if an I/O error occurspublic iaik.asn1.ASN1Object createPKCS7EncryptedData(byte[] message, iaik.asn1.structures.AlgorithmID pbeAlgorithm, char[] password) throws iaik.pkcs.PKCSException, java.io.IOException
EncryptedData
message.
The supplied content is PBE-encrypted using the specified password.
message
- the message to be encrypted, as byte representationpbeAlgorithm
- the PBE algorithm to be usedpassword
- the passwordEncryptedData
object just creatediaik.pkcs.PKCSException
- if the EncryptedData
object cannot
be createdjava.io.IOException
- if an I/O error occurspublic byte[] getPKCS7EncryptedData(iaik.asn1.ASN1Object asn1Object, char[] password) throws iaik.pkcs.PKCSException, java.io.IOException
EncryptedData
object
using the specified password and returns the decrypted (= original) message.asn1Object
- the EncryptedData
object as ASN1Objectpassword
- the password to decrypt the messageiaik.pkcs.PKCSException
- if the message cannot be recoveredjava.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