Hi, I have a doubt. I am working with addLtv method but I don't know how to
take all certificate chain of TSA and not only one cerficate of this one. 

Probably this issue is the root cause of my problem with succesfull pass the 
LtvVerifier. 

I put this file sample:

https://storage.dataokey.com:7001/fbsharing/sEU0AmgG

I appreciate your comments.
Regards,


Sample Code: 

public void addLtv(String src, String dest, OcspClient ocsp, CrlClient crl,
TSAClient tsa) throws IOException, DocumentException,
GeneralSecurityException {
        PdfReader r = new PdfReader(src);
        FileOutputStream fos = new FileOutputStream(dest);
        PdfStamper stp = PdfStamper.createSignature(r, fos, '\0', null,
true);
        LtvVerification v = stp.getLtvVerification();
        AcroFields fields = stp.getAcroFields();
        List<String> names = fields.getSignatureNames();
        String sigName = names.get(names.size() - 1);
        PdfPKCS7 pkcs7 = fields.verifySignature(sigName);
        if (pkcs7.isTsp()) {
            v.addVerification(sigName, ocsp, crl,
                    LtvVerification.CertificateOption.SIGNING_CERTIFICATE,
                    LtvVerification.Level.OCSP_CRL,
                    LtvVerification.CertificateInclusion.YES);
        } else {
            for (String name : names) {
                v.addVerification(name, ocsp, crl,
                        LtvVerification.CertificateOption.WHOLE_CHAIN,
                        LtvVerification.Level.OCSP_CRL,
                        LtvVerification.CertificateInclusion.YES);
            }
        }

        PdfSignatureAppearance sap = stp.getSignatureAppearance();
       
  * **HERE!!!* ---> LtvTimestamp.timestamp(sap, tsa, null);

        v.merge();

    }




--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/addLtv-Method-tp4659985.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to