Am 15.02.2020 um 13:22 schrieb Cristina Ruica:
The server code is correct. I'm using it in external signature with
iText,and it works fine.
I think the problem is with the bytes that are returned from sign method,
because i saw in another examples that sign method returns
CMSSignedDate.getEncoded(), which is actually the ASN.1 encoded
representation.
I tried  this, but the byte array returned  with  Base64.decode(signature)
is not what CMSSignedData constructor is expecting..
             CMSSignedData cms=new CMSSignedData(Base64.decode(signature));

             return cms.getEncoded();


Yeah I looked back at your original code, and it looks OK assuming that your server is OK.

After the base64 is decoded, what do you get? Binary bytes or hex bytes?

When you enter your base64 stuff at

https://lapo.it/asn1js/

does it output anything?

And if you look at the source code of itext (put a break point after you get the result), what does it do with the result of the server? In PDFBox it only converts to hex bytes, which are later written into the PDF.

Tilman


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to