IExternalSignature externalSignature = new X509Certificate2Signature(Certificate, "SHA-1") TsaClient = new TSAClientBounc圜astle(strTSA) OcspClient = new OcspClientBounc圜astle() SignatureAppearance.SetVisibleSignature(new Rectangle(100, 100, 300, 200), 1, null) //signatureAppearance.SetVisibleSignature(new Rectangle(100, 100, 250, 150), objReader.NumberOfPages, "Signature") PdfSignatureAppearance signatureAppearance = objStamper.SignatureAppearance PdfStamper objStamper = PdfStamper.CreateSignature(objReader, new FileStream(Target, FileMode.Create), '\0',null,true) PdfReader objReader = new PdfReader(Source) If (!=0) ĬrlList.Add(new CrlClientOnline(objChain)) Private void button1_Click(object sender, EventArgs e) Necesito por supuesto que esa firma se vea luego en el PDF para que los solicitantes sepan quién se los firmó. ![]() Con este método recorro un listbox con la lista de todos los PDF seleccionados para firmar e intento crear un campo, pero no sé como lograr que ese campo se cree en el PDF y hacer la firma. X509Certificate2 certificadoElegido = scollection ĬertificadoElegido = scollection //certificadoElegido es vble de clase X509Certificate2Collection scollection = X509Certificate2UI.SelectFromCollection(fcollection, "Lista de Certificados digitales instalados en su equipo", "Seleccion el certificado con el que desea firmar", X509SelectionFlag.SingleSelection) X509Certificate2Collection fcollection = (X509Certificate2Collection)collection.Find(X509FindType.FindByTimeValid, DateTime.Now, false) X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates X509Store store= new X509Store(StoreName.My,StoreLocation.CurrentUser) Private void btnExplorar_Click(object sender, EventArgs e) //Con el método de abajo abro el almacén de certificados y selecciono uno para firmar. But I can't create a field and insert the signature, previously asking for the token key. Then another button that opens the Windows certificate store to select the certificate to sign. What I have so far is a button that opens a dialog that allows you to select all the PDFs to sign. From what I've been researching, it can be done. ![]() People who have to sign sign about 200 PDFs per day, so I am developing a desktop application in C # that allows me to sign all PDFs in one go, since with Adobe they have to open the PDF, create a field of signature, put the token key and the signature just appears, this multiplied by 100 or 200 depending on the day. The signature is being done with the Adobe wizard and using tokens with digital signature installed on the computer. In my work, they use a digital signature to validate PDF files that are then delivered to those who request them (who do not belong to the company), so the signature with the signer's data must be seen in the PDF.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |