Skip to content

Conversation

schiopumadalin
Copy link

Hi guys,

We are back with the pull request, after including the Attachment Annotations as well beside the Digital Signatures.
We included in the commit a sample project for these features.

Waiting for your feedback,
KDS Team

@Bicolt Bicolt mentioned this pull request Mar 24, 2017
@jcalixv
Copy link

jcalixv commented Jun 22, 2017

Hi, First of all, Thank you very much for your enhancements, just what I need.
I Just tried your code and it does sign previously created pdf files.
The Signer contact's Info is not showing, but... not importan.

I just read comments and the PdfSharp team wont be adding this any time soon, many of us will love to have this functions, in my case, sign and verity pdf signatures (failed to find the verify signature part) is all I need, but cross platform (Xamarin.Android, Xamarin.Ios and Net 4.5.

Are you gonna keep working on this at least add the verify signature part???
Thank you so much for your time.

Note.
Is it of, if I take this code and try to make it Net Standard??

Update...
According to the Net Portability Analizer This Project cannot be ported to Net Portable or Net Standard.
Well, this is it for me. I need to sign the created PDF from Xamarin.Android and Xamarin.Ios (using the Keystore/keychain Private Key)

Thanks

@farlop
Copy link

farlop commented Sep 6, 2017

Hi! We are trying to use your PR in order to digitally sign PDFs by different people. It is working fine when the document is not signed, but when we try to add a second sign to the file, it fails. At first time, it fails trying to add the 'SigFlags' keys (which already exists). After adding code to control this in 'AddSignatureComponents' method, the PDF file is successfully generated, but opening with Acrobat Reader shows that the first sign is not valid, just the second one. We don't know how to proceed in this situation, could you please give me a hand?

@Gingetsuryuu
Copy link

Hi. I needed this feature for a project,but I needed a few changes to it, and I needed it with the existing stable release. I've gone ahead and a made a fork, and locally merged this into a stable release and made a few changes. I don't want to step on @schiopumadalin 's toes or anyone else's though, so what should I do?

@qwertyuiope
Copy link

why this hasnt been merged yet? At least will work with only one signature

@ThomasHoevel
Copy link
Member

why this hasnt been merged yet? At least will work with only one signature

Why? No sample PDFs for QA, unclear what it does, ...

It's nice if people want to contribute. It's bad if the Pull Request is their first contact. It would be nice if people would contact us before changing the first line of code.

Feel free to use that code in your project.

@qwertyuiope
Copy link

why this hasnt been merged yet? At least will work with only one signature

Why? No sample PDFs for QA, unclear what it does, ...

It's nice if people want to contribute. It's bad if the Pull Request is their first contact. It would be nice if people would contact us before changing the first line of code.

Feel free to use that code in your project.

Is included sample project and tests. What it does? Support of Digital Signatures and Attachment Annotations.

k59319 pushed a commit to mapilab/PDFsharp that referenced this pull request Jun 15, 2020
Field types exposed
@titothetitan
Copy link

titothetitan commented Nov 10, 2020

How do I exactly will open the Certificate and get data with this nearly empty method without informing the password in Program.cs?

private static X509Certificate2 GetCertificate() { throw new NotImplementedException("Put your certificate path here"); //return new X509Certificate2(....); }

@titothetitan
Copy link

I've solved my issue doing this:

private static X509Certificate2 GetCertificate() { return new X509Certificate2("D:\\certificado\\Imediata2021.pfx", "1234", X509KeyStorageFlags.Exportable); }

@titothetitan
Copy link

I'm having trouble signing it with a smartcard (A3)

CryptographicException “Key not valid for use in specified state

@harafat007
Copy link

harafat007 commented Jan 8, 2021

Hello, what is the nuget package for using the PDFSignature funtionality ? I tried PDFsharp-MigraDoc-gdi Version#1.50.5147 but it didnt work.

@MattLebrao
Copy link

Hello, what is the nuget package for using the PDFSignature funtionality ? I tried PDFsharp-MigraDoc-gdi Version#1.50.5147 but it didnt work.

Empira has not yet merged this pull request with the branch. If you want to use the new functionality implemented here, you'll have to compile the library yourself based on KDS' version.

@AYGTX
Copy link

AYGTX commented Apr 6, 2022

anyone using this PR ? any issues so far ?

@jimiwills
Copy link

I'm using it. It's pretty great... except the graphical part seems to not be visible in the output.
Part of the joy of having the code rather than a nuget is you can fiddle !! But really "unclear what it does" is kinda mad. This should have had comment and review and been merged 2 years ago. (IMO)

Anyway, I'm building a pdf using QuestPDF, and signing it. Adobe recognises that the file is signed, and also if you've edited it after signing (e.g. in DrawBoard, which allows editing signed file thereby invalidating them) - so that's perfect. The visual components are not visible, but I'm assuming that's something to do with Quest vs PDF# (vs WPF maybe)

@IvanTatur
Copy link

I'm using it. It's pretty great... except the graphical part seems to not be visible in the output. Part of the joy of having the code rather than a nuget is you can fiddle !! But really "unclear what it does" is kinda mad. This should have had comment and review and been merged 2 years ago. (IMO)

Anyway, I'm building a pdf using QuestPDF, and signing it. Adobe recognises that the file is signed, and also if you've edited it after signing (e.g. in DrawBoard, which allows editing signed file thereby invalidating them) - so that's perfect. The visual components are not visible, but I'm assuming that's something to do with Quest vs PDF# (vs WPF maybe)

could you share an example of signing pdf please?

@julienrffr
Copy link

FYI this pull request has been ported to the new PDFsharp 6 in empira/PDFsharp#48

Also, we did a nuget package of PDFsharp 6 with additional features, including signature. Try it here https://www.nuget.org/packages/PDFsharp-extended/

@schiopumadalin
Copy link
Author

schiopumadalin commented Nov 7, 2023

Cool. Thanks for the info. It is always better later (after 7 years) than never :)

@loudenvier
Copy link

loudenvier commented Nov 8, 2023

Does this code add support for PADES signatures? https://en.wikipedia.org/wiki/PAdES Or only PKCS detached?

@julienrffr
Copy link

Does this code add support for PADES signatures? https://en.wikipedia.org/wiki/PAdES Or only PKCS detached?

This code produces PCKS7-B signatures only at the moment.
We have the code to add embedding of certificate revocation information in order to make the signature ready for LTV, we may release it in the new pull request when we have some time.

I encourage you to improve current signature code by doing pull requests on https://github.com/KDS/PDFsharp/tree/signature-feature

@loudenvier
Copy link

Does this code add support for PADES signatures? https://en.wikipedia.org/wiki/PAdES Or only PKCS detached?

This code produces PCKS7-B signatures only at the moment. We have the code to add embedding of certificate revocation information in order to make the signature ready for LTV, we may release it in the new pull request when we have some time.

I encourage you to improve current signature code by doing pull requests on https://github.com/KDS/PDFsharp/tree/signature-feature

Since I didn't know anything about PDF signatures up to a few days back I'm still figuring it all out. I'm trying out other libraries and using a few applications (Acrobat Reader, etc.) to sign PDFs and to see the exact output to find out where everything fits :-) If I manage to improve the library in any way I'll contribute with pull requests.

@aamir-munir
Copy link

Does anyone have some sample code to use this feature? Thanks in advance.

@aamir-munir
Copy link

Does this code add support for PADES signatures? https://en.wikipedia.org/wiki/PAdES Or only PKCS detached?

This code produces PCKS7-B signatures only at the moment. We have the code to add embedding of certificate revocation information in order to make the signature ready for LTV, we may release it in the new pull request when we have some time.
I encourage you to improve current signature code by doing pull requests on https://github.com/KDS/PDFsharp/tree/signature-feature

Since I didn't know anything about PDF signatures up to a few days back I'm still figuring it all out. I'm trying out other libraries and using a few applications (Acrobat Reader, etc.) to sign PDFs and to see the exact output to find out where everything fits :-) If I manage to improve the library in any way I'll contribute with pull requests.

did you find anything good? I am still struggling to add a field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.