Hi,

Thanx for previous reply and good guidance. For your ease the thread link of
previous reply is as follows:

 

http://www.mail-archive.com/itext-questions%40lists.sourceforge.net/msg31595
.html

 

 

Now I'm facing a problem in adding revocation information during signing.
I'm successful to add RFC3161 Timestamp Token in PKCS#7 but unable to add
CRL in PKCS#7. The problem is that after adding revocation information the
signature is no more valid. By opening PDF it is showing signature as
corrupted/invalid.

Please help me in this regard. Am I doing any thing wrong?

 

The sample code is as follows:

 

ObjectID REVOCATION_OID = new ObjectID("1.2.840.113583.1.1.8",
"RevocationInfoArchival");

        SEQUENCE obj_revocationInfo = new SEQUENCE();

 

        SEQUENCE obj_crl = new SEQUENCE();

        try {

            FileInputStream obj_in = new FileInputStream("test.crl");

            iaik.x509.X509CRL obj_x509Crl = new iaik.x509.X509CRL(obj_in);

            obj_in.close();

            obj_crl.addComponent(new
OCTET_STRING(obj_x509Crl.getEncoded()));

            obj_revocationInfo.addComponent(obj_crl);

       } catch (Exception ex) {

            m_objLogger.logException("CRL Revocation Information can't be
embedded", ex);

            return b_revoResponse;

        }

 

 

          try {

            Attribute[] Signed_attributes = new Attribute[1];

            Signed_attributes[0] = new Attribute(REVOCATION_OID, new
ASN1Object[] {new ASN1(obj_revocationInfo).toASN1Object()});

 
m_objSignedData.getSignerInfos()[0].setAuthenticatedAttributes(Signed_attrib
utes);

        } catch (Exception ex) {

            m_objLogger.logException("Unable to assign Authenticated
Attributes", ex);

            return false;

        }

 

Regards,

KS

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to