数字签名具有多个签名的PDF。在itext7中使用追加模式PdfStamper

时间:2016-12-09 08:52:57

标签: c# pdf itext7

我正在尝试使用itext7以附加模式对PDF进行数字签名。我在同一个pdf文件上有多个签名。我现在指的是Bruno Lowagie的白皮书来解决这个问题。我没有在iText7中获得PdfStamper的任何替代方案。我目前使用的代码在下面分享: -

PdfReader reader = new PdfReader(src);
FileStream os = new FileStream(dest,FileMode.Open);
PdfStamper stamper = PdfStamper.createSignature(reader, os, '\\', null, true);
//  Creating the appearance
PdfSignatureAppearance appearance = stamper.getSignatureAppearance();
appearance.setVisibleSignature(name);
appearance.setCertificationLevel(level);
//  Creating the signature
ExternalSignature pks = new PrivateKeySignature(pk, "SHA-256", "BC");
MakeSignature.signDetached(appearance, digest, pks, chain, null, null, null, 0, CryptoStandard.CMS);

0 个答案:

没有答案