public class SigningCertificateV2Demo extends SigningCertificateDemo
SigningCertificateV2
attribute to the SignerInfo of a SignedDataStream
or
SignedData
object. The SigningCertificateV2 attributes maybe used
to include certificate identification information into the signed attributes of a
CMS SignerInfo
object. It has been introduced by
RFC 5035 to allow to use the SigningCertificate
attribute with other hash algorithms than SHA-1.SigningCertificate
,
SigningCertificateV2
,
SignerInfo
,
SignedDataStream
,
SignedData
Constructor and Description |
---|
SigningCertificateV2Demo()
Setups the demo certificate chains.
|
Modifier and Type | Method and Description |
---|---|
protected iaik.smime.ess.SigningCertificate |
createSigningCertificate(java.security.cert.Certificate[] certs)
Creates a SigningCertificateV2 attribute for the given certificates.
|
protected iaik.smime.ess.SigningCertificate |
getSigningCertificate(iaik.cms.SignerInfo signerInfo)
Gets the SigningCertificateV2 attribute from the given SignerInfo.
|
static void |
main(java.lang.String[] args)
The main method.
|
protected void |
printHeader()
Prints some header lines to System.out.
|
createAttributeCertificate, createSignedData, createSignedDataStream, getSignedData, getSignedDataStream, start
public SigningCertificateV2Demo() throws java.io.IOException
java.io.IOException
- if an file read error occursprotected iaik.smime.ess.SigningCertificate createSigningCertificate(java.security.cert.Certificate[] certs) throws iaik.cms.CMSException
createSigningCertificate
in class SigningCertificateDemo
certs
- the certificates for which to create the SigningCertificateV2
attributeiaik.cms.CMSException
- if an error occurs when creating the
SigningCertificateV2 attributeprotected iaik.smime.ess.SigningCertificate getSigningCertificate(iaik.cms.SignerInfo signerInfo) throws iaik.cms.CMSException
getSigningCertificate
in class SigningCertificateDemo
signerInfo
- the SignerInfo from which to get the
SigningCertificateV2 attributenull
if no SigningCertificate attribute is includediaik.cms.CMSException
- if an error occurs when getting the
SigningCertificateV2 attributeprotected void printHeader()
printHeader
in class SigningCertificateDemo
public static void main(java.lang.String[] args) throws java.lang.Exception
java.io.IOException
- if an I/O error occurs when reading required keys
and certificates from filesjava.lang.Exception