Hi,
I'm signing a PDF with existing signature field per PKCS12 key.
After some tries I figured this out
PdfFileSignature pdfSign2 = new PdfFileSignature( @"C:\page_1.pdf");
PKCS1 p1 = new PKCS1(@"C:\key.pfx", "xyz");
p1.Reason = "Reason";
p1.Location = "Location";
p1.ContactInfo = "ContactInfo";
p1.ShowProperties = false;
pdfSign2.SignatureAppearance = @"C:\sig.jpg";
pdfSign2.Sign("SigField", p1);
pdfSign2.Save(@"F:\page_1_Sign1.pdf");
Now I have some questions.
I'm signing a PDF with existing signature field per PKCS12 key.
After some tries I figured this out
PdfFileSignature pdfSign2 = new PdfFileSignature( @"C:\page_1.pdf");
PKCS1 p1 = new PKCS1(@"C:\key.pfx", "xyz");
p1.Reason = "Reason";
p1.Location = "Location";
p1.ContactInfo = "ContactInfo";
p1.ShowProperties = false;
pdfSign2.SignatureAppearance = @"C:\sig.jpg";
pdfSign2.Sign("SigField", p1);
pdfSign2.Save(@"F:\page_1_Sign1.pdf");
Now I have some questions.
- Do I really have to use a PKCS1 object for my PKCS12 key?
- Is there a way to avoid a streched signature image if it doesn't fit the signature field exactly (it never will...)?
- Is there a way to put an image inside the signature field only (no signature key)?