I have described my issue below reateld to external and deferred signing
1. We have PDF which I need to digitally sign
2. I will create Hash of PDF which will be sen to Third party service which will sign the hash with private key
3. Third party service will return public key in PEM format and signed hash value
4. Note: Third party will not share the private key
5. I need to sign PDF using above two values
How can I achieve using iText or any other like library in C#.
Can you share sample code which can be used to exactly do this
I have referred multiple links. like below and also created sample (link below). Please help urgently.
Link I have referred so far:
https://stackoverflow.com/questions/47505696/itext-pdf-deferred-signing-results-in-pdf-with-invalid-signature
https://stackoverflow.com/questions/33019686/itext-signing-pdf-using-external-signature-with-smart-card
Based on all this idea I have created some code below. Not sure if my approach is correct. Please help.
I have uploaded my code at - https://1drv.ms/u/s!Al69FgQ8jwmZbgiBMXLLM4j5sbU?e=vyGF4m
The code contains sample PDFs also.