public class SignedDataInOutStreamDemoWithAdditionalSignerInfo extends java.lang.Object
| Constructor and Description |
|---|
SignedDataInOutStreamDemoWithAdditionalSignerInfo()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
createSignedDataStream(byte[] message,
int mode)
Creates a CMS
SignedData object. |
byte[] |
getSignedDataStream(byte[] signedData,
byte[] message,
boolean writeAgain)
Parses a CMS
SignedData object and verifies the signatures
for all participated signers. |
static void |
main(java.lang.String[] argv)
The main method.
|
void |
start()
Starts the test.
|
public SignedDataInOutStreamDemoWithAdditionalSignerInfo()
public byte[] createSignedDataStream(byte[] message, int mode) throws iaik.cms.CMSException, java.io.IOException
SignedData object.
message - the message to be signed, as byte representationmode - the mode indicating whether to include the content
(SignedDataStream.IMPLICIT) or not (SignedDataStream.EXPLICIT)SignedData object just creatediaik.cms.CMSException - if the SignedData object cannot
be createdjava.io.IOException - if an I/O error occurspublic byte[] getSignedDataStream(byte[] signedData, byte[] message, boolean writeAgain) throws iaik.cms.CMSException, java.io.IOException, java.security.NoSuchAlgorithmException
SignedData object and verifies the signatures
for all participated signers.signedData - the SignedData, as BER encoded byte arraymessage - the message which was transmitted out-of-band (if explicit signed)writeAgain - whether to add a SignerInfo and encode the SignedData againiaik.cms.CMSException - if any signature does not verifyjava.io.IOException - if an I/O error occursjava.security.NoSuchAlgorithmExceptionpublic void start()
public static void main(java.lang.String[] argv) throws java.io.IOException
java.io.IOException - if an I/O error occurs when reading required keys
and certificates from files