|
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.signedData.PssSignedDataDemo
public class PssSignedDataDemo
This class demonstrates the CMS SignedData implementation for the RSA-PSS (PKCS#1v2.1) algorithm.
Constructor Summary | |
---|---|
PssSignedDataDemo()
Setups the demo certificate chains. |
Method Summary | |
---|---|
static iaik.asn1.structures.AlgorithmID |
createPssAlgorithmID(iaik.asn1.structures.AlgorithmID hashID,
iaik.asn1.structures.AlgorithmID mgfID,
int saltLength)
Creates an RSA-PSS AlgorithmID with the supplied parameters (hash algorithm id, mask generation function, salt length). |
byte[] |
createSignedData(byte[] message,
int mode)
Creates a CMS SignedData object. |
byte[] |
createSignedDataStream(byte[] message,
int mode)
Creates a CMS SignedData object. |
byte[] |
getSignedData(byte[] encoding,
byte[] message)
Parses a CMS SignedData object and verifies the signatures
for all participated signers. |
byte[] |
getSignedDataStream(byte[] signedData,
byte[] message)
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()
Tests the CMS SignedData implementation for the RSA-PSS (PKCS#1v2.1) algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PssSignedDataDemo() throws java.io.IOException
java.io.IOException
- if an file read error occursMethod Detail |
---|
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 transmission mode, either IMPLICIT or EXPLICIT
SignedData
object just created
iaik.cms.CMSException
- if the SignedData
object cannot
be created
java.io.IOException
- if some stream I/O error occurspublic byte[] getSignedDataStream(byte[] signedData, byte[] message) throws iaik.cms.CMSException, java.io.IOException
SignedData
object and verifies the signatures
for all participated signers.
signedData
- SignedData
object as BER encoded byte arraymessage
- the message which was transmitted out-of-band (if explicit signed),
otherwise null
(implicit signed)
iaik.cms.CMSException
- if any signature does not verify
java.io.IOException
- if some stream I/O error occurspublic byte[] createSignedData(byte[] message, int mode) throws iaik.cms.CMSException
SignedData
object.
message
- the message to be signed, as byte representationmode
- the mode, either SignedData.IMPLICIT or SignedData.EXPLICIT
SignedData
object
iaik.cms.CMSException
- if the SignedData
object cannot
be createdpublic byte[] getSignedData(byte[] encoding, byte[] message) throws iaik.cms.CMSException, java.io.IOException
SignedData
object and verifies the signatures
for all participated signers.
encoding
- the DER encoded SignedData
objectmessage
- the message which was transmitted out-of-band (if explicit signed),
otherwise null
(implicit signed)
iaik.cms.CMSException
- if any signature does not verify
java.io.IOException
- if some stream I/O error occurspublic static iaik.asn1.structures.AlgorithmID createPssAlgorithmID(iaik.asn1.structures.AlgorithmID hashID, iaik.asn1.structures.AlgorithmID mgfID, int saltLength) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException
hashID
- the hash algorithm to be usedmgfID
- the mask generation function to be usedsaltLength
- the salt length to be used
java.security.InvalidAlgorithmParameterException
- if the parameters cannot be created/set
java.security.NoSuchAlgorithmException
- if there is no AlgorithmParameters implementation
for RSA-PSSpublic void start()
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
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 |
![]() |