public class PKCS7CMSDigestedDataDemo extends java.lang.Object
Constructor and Description |
---|
PKCS7CMSDigestedDataDemo()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
iaik.asn1.ASN1Object |
createDigestedData(byte[] message,
int mode)
Creates a CMS
DigestedData object. |
byte[] |
createDigestedDataStream(byte[] message,
int mode)
Creates a CMS
DigestedData object. |
iaik.asn1.ASN1Object |
createPKCS7DigestedData(byte[] message,
int mode)
Creates a PKCS#7
DigestedData object. |
byte[] |
createPKCS7DigestedDataStream(byte[] message,
int mode)
Creates a PKCS#7
DigestedData object. |
byte[] |
getDigestedData(iaik.asn1.ASN1Object obj,
byte[] message)
Parses a CMS
DigestedData object and verifies the hash value. |
byte[] |
getDigestedDataStream(byte[] digestedData,
byte[] message)
Parses a CMS
DigestedData object and verifies the hash. |
byte[] |
getPKCS7DigestedData(iaik.asn1.ASN1Object obj,
byte[] message)
Parses a PKCS#7
DigestedData object and verifies the hash value. |
byte[] |
getPKCS7DigestedDataStream(byte[] digestedData,
byte[] message)
Parses a PKCS#7
DigestedData object and verifies the hash. |
static void |
main(java.lang.String[] argv)
Tests the IAIK CMS DigestedData(Stream) implementation against
the PKCS#7 DigestedData(Stream) implementation
|
void |
start()
Starts the tests.
|
public PKCS7CMSDigestedDataDemo() throws java.io.IOException
java.io.IOException
public byte[] createDigestedDataStream(byte[] message, int mode) throws iaik.cms.CMSException, java.io.IOException
DigestedData
object.
message
- the message to be digested, as byte representationmode
- IMPLICIT (include message) or EXPLICIT (do not include message)DigestedData
object just creatediaik.cms.CMSException
- if the DigestedData
object cannot
be createdjava.io.IOException
- if an I/O error occurspublic byte[] getDigestedDataStream(byte[] digestedData, byte[] message) throws iaik.cms.CMSException, java.io.IOException
DigestedData
object and verifies the hash.digestedData
- DigestedData
object as DER encoded byte arraymessage
- the the message which was transmitted out-of-bandiaik.cms.CMSException
- if any signature does not verifyjava.io.IOException
- if an I/O error occurspublic iaik.asn1.ASN1Object createDigestedData(byte[] message, int mode) throws iaik.cms.CMSException, java.io.IOException
DigestedData
object.
message
- the message to be digested, as byte representationmode
- IMPLICIT (include message) or EXPLICIT (do not include message)DigestedData
as ASN.1 objectiaik.cms.CMSException
- if the DigestedData
object cannot
be createdjava.io.IOException
- if an I/O error occurspublic byte[] getDigestedData(iaik.asn1.ASN1Object obj, byte[] message) throws iaik.cms.CMSException, java.io.IOException
DigestedData
object and verifies the hash value.obj
- DigestedData
object in ASN.1 representationmessage
- the the message which was transmitted out-of-band (explicit digested)iaik.cms.CMSException
- if some parsing exception occursjava.io.IOException
- if an I/O error occurspublic byte[] createPKCS7DigestedDataStream(byte[] message, int mode) throws iaik.pkcs.PKCSException, java.io.IOException
DigestedData
object.
message
- the message to be digested, as byte representationmode
- IMPLICIT (include message) or EXPLICIT (do not include message)DigestedData
object just creatediaik.pkcs.PKCSException
- if the DigestedData
object cannot
be createdjava.io.IOException
- if an I/O error occurspublic byte[] getPKCS7DigestedDataStream(byte[] digestedData, byte[] message) throws iaik.pkcs.PKCSException, java.io.IOException
DigestedData
object and verifies the hash.digestedData
- DigestedData
object as DER encoded byte arraymessage
- the the message which was transmitted out-of-bandiaik.pkcs.PKCSException
- if any signature does not verifyjava.io.IOException
- if an I/O error occurspublic iaik.asn1.ASN1Object createPKCS7DigestedData(byte[] message, int mode) throws iaik.pkcs.PKCSException, java.io.IOException
DigestedData
object.
message
- the message to be digested, as byte representationmode
- IMPLICIT (include message) or EXPLICIT (do not include message)DigestedData
as ASN.1 objectiaik.pkcs.PKCSException
- if the DigestedData
object cannot
be createdjava.io.IOException
- if an I/O error occurspublic byte[] getPKCS7DigestedData(iaik.asn1.ASN1Object obj, byte[] message) throws iaik.pkcs.PKCSException, java.io.IOException
DigestedData
object and verifies the hash value.obj
- DigestedData
object in ASN.1 representationmessage
- the the message which was transmitted out-of-band (explicit digested)iaik.pkcs.PKCSException
- if some parsing exception occursjava.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