是否可以使用iTextSharp library
,处理数字签名并将其与内存流相关联
稍后返回此内存流,以便在从该内存流创建PDF
文件时创建一个经过数字签名的文件
public MemoryStream Sign(MemoryStream ms)
{
PdfReader reader = new PdfReader(ms);
//I also try
//PdfReader reader = new PdfReader(ms.ToArray());
PdfStamper st = new PdfStamper(reader, ms, '\0', true);
PdfSignatureAppearance sap = st.SignatureAppearance;
sap.SetCrypto(this.myCert.Akp, this.myCert.Chain, null, PdfSignatureAppearance.WINCER_SIGNED);
sap.SetVisibleSignature(new iTextSharp.text.Rectangle(100, 100, 250, 150), 1, null);
return ms;
}
它提供错误的PDF标题签名未找到。