我試圖進行數字簽名使用PDFBOX(和BouncyCastle的)PDFBox的+充氣城堡簽署PDF
我已經創建密鑰庫和證書(加密?)PDF想要使用PDFBOX
org.apache.pdfbox.PDFBox Encrypt -certFile test-cert.cer -canModify false -canPrint false test.pdf test-signed-out.pdf
,我已經有了:
Encrypt failed with the following exception:
org.apache.pdfbox.exceptions.COSVisitorException: Cannot find any provider supporting 1.2.840.10040.4.1
at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1025)
at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:914)
at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:895)
at org.apache.pdfbox.Encrypt.encrypt(Encrypt.java:189)
at org.apache.pdfbox.Encrypt.main(Encrypt.java:53)
at org.apache.pdfbox.PDFBox.main(PDFBox.java:40)
org.apache.pdfbox.exceptions.CryptographyException: Cannot find any provider supporting 1.2.840.10040.4.1
at org.apache.pdfbox.pdmodel.encryption.PublicKeySecurityHandler.prepareDocumentForEncryption(PublicKeySecurityHandler.java:344)
at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1016)
什麼問題?我做錯了什麼?
我可以使用PDFBox的ShowCertificate上已經簽約(由iText的)PDF: 簽名算法:SHA1的DSA,OID = 1.2.840.10040.4.3
請參考文章:http://stackoverflow.com/questions/22354607/how-to-digitally-sign-a-dynamically-created-pdf-document-using-pdfbox – AVA 2014-04-17 11:36:33