[英]Signing a PDF with iTextSharp
I've been using iTextSharp to sign PDFs in my application, and it works pretty good using this code I adapted from the java example on the iText website: 我一直在使用iTextSharp在我的应用程序中对PDF进行签名,并且使用从iText网站上的Java示例改编而成的以下代码,它可以很好地工作:
PdfStamper stp = PdfStamper.CreateSignature(reader, outmemstream, ControlChars.NullChar);
PdfSignatureAppearance sap = stp.SignatureAppearance;
sap.SetCrypto(prvKey, new X509Certificate[] {sigCert, Repository.CAcertificate}, null, pdfSignatureAppearance.SELF_SIGNED);
sap.Reason = "Just to proove I can sign!";
This has worked ok until version 5.2.1 of iText, but in the recent version 5.3.0 the "SetCrypto" method has been removed and I cannot sign anymore! 在iText的5.2.1版之前,此方法一直有效,但是在最新的5.3.0版中,“ SetCrypto”方法已删除,我无法再签名! Any ideas on why it has been removed and what may be an alternative method to sign a pdf on the new version?? 关于为什么要删除它的任何想法,以及在新版本上签名pdf的替代方法是什么?
Thanks in advance 提前致谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.