Using (PdfStamper stamper = PdfStamper.CreateSignature(reader, fout, '\0')) Using (FileStream fout = new FileStream(destinationPath, FileMode.Create, FileAccess.ReadWrite)) PdfReader reader = new PdfReader(sourceDocument) then Iterate throught certificate entries to find the private key entry Pkcs12Store pk12=new Pkcs12Store(privateKeyStream, keyPassword.ToCharArray()) Public static void signPdfFile (string sourceDocument, string destinationPath, Stream privateKeyStream, string keyPassword, string reason, string location) / Location where the document was signed, would be embedded as part of the signature / String describing the reason for signing, would be embedded as part of the signature pfx format which would be used to sign the document / A Stream containing the private/public key in. / The path at which the signed pdf document should be generated / The path of the source pdf document which is to be signed / Signs a PDF document using iTextSharp library Pfx file using DigiSign(Online tool) and then using windows to generate the certificate(.cer) file /// I am trying to digitally sign and Verify pdf documents on server(c#) using iTextSharp 5.3.3.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |