No, but in my case it would never happen, because my certificate is trusted for signing, but not certifying:



Diego Azevedo

On 18/10/2016 13:30, Damien Butaye wrote:
One last question, have you got the "blue ribbon" on the top the pdf when you open it with Acrobat? In my case not, although it is well certified as shown in the Acrobat Signature Panel.

2016-10-18 15:58 GMT+02:00 Damien Butaye < <>>:

    Nice! Thank you very much!

    (Btw, it could be nice to integrate  in a future release a method
    certify() in the PDSignature object).


    2016-10-18 15:42 GMT+02:00 Diego Azevedo <

        Hello Damien,

        I made a typo:

            dictionary.setItem("Reference", reference_*s*_); // Add
            Array to Signature dictionary

        There is no point in creating the array, add the "SigRef"
        dictionary to it... and not use the array on the "Sig"
        dictionary.  So... just add the 'S' to the variable and re-run
        it. Just tested here, and it worked fine =)


-- *_______________________________________________

        Diego Azevedo
        E-SEC Seguran├ža Digital <>
        +55 61 3323-4410 <tel:%2B55%2061%203323-4410>*

        On 18/10/2016 10:21, Damien Butaye wrote:
        Hello Diego,

         Thank you for your help. I just tried your code but it seems
        that it doesn't work. The result has nor signature nor
        certify element. I'll try again.
        If you have any idea, don't hesitate ;)


        2016-10-18 13:04 GMT+02:00 Diego Azevedo
        < <>>:

            From what I'm reading on ISO 32000, the certification
            Signature is a normal signature, but with a DocMDP
            transform method. So the ou should do something like this:

                PDSignature signature = new PDSignature;
                [..] //do your thing
                COSDictinary dictionary = signature.getCOSObject();

                //Create a reference dictionary
                COSDictionary reference = new COSDictionary();
                reference.setItem("Type", COSName.getPDFName("SigRef"));
                COSName.getPDFName("SHA1")); //Only MD5 or SHA1... Go
                with the least worse

                //Now we add DocMDP specific stuff
                COSDictionary transformParameters = new COSDictionary();
                transformParameters.setInteger("P", <1, 2 or 3>); //
                1- no changes permited; 2- fill forms and signing; 3-
                Same as 2 plus annotation creation, deletion an
                COSName.getPDFName("1.2")); // This is right, it's a
                name, not a number.

                // Add everything in order
                transformParameters ); // Add DocMDP stuff to the
                SigRef Dictionary;
                COSArray references = new COSArray();
                references.add(reference); // Add SigRef Dictionary
                to a Array
                dictionary.setItem("Reference", reference); // Add
                Array to Signature dictionary

            I didn't try it myself, just wrote based on PdfBox API
            and ISO specification. May have errors.

            On 18/10/2016 06:12, Damien Butaye wrote:
            Hello Tilman,

              Here follows two links explaining the difference :

            2016-10-18 8:49 GMT+02:00 Tilman Hausherr
            <> <>:
            Dear all,
                I'm looking for a solution to certify a PDF. Currently I'm able 
            sign a
            PDF using PDFBox but I can't certify it. Is-it possible to do it 

            Thank you for your help!

            What's the difference? (See my other answer from today)


            To unsubscribe,
            For additional commands,

Reply via email to