Created
September 25, 2019 10:54
-
-
Save GroupDocsGists/4b6047f897d21ce8d268f4b7972a8ad6 to your computer and use it in GitHub Desktop.
Steps for Adding Digital Signature to PDF Documents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Signature; | |
using GroupDocs.Signature.Domain; | |
using GroupDocs.Signature.Options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DigitalVerifyOptions options = new DigitalVerifyOptions("certificate.pfx") | |
{ | |
Comments = "Test comment" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (Signature signature = new Signature("sample.pdf")) | |
{ | |
// Your code goes here. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (result.IsValid) | |
{ | |
Console.WriteLine("\nDocument was verified successfully!"); | |
} | |
else | |
{ | |
Console.WriteLine("\nDocument failed verification process."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// verify document signatures | |
VerificationResult result = signature.Verify(options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Signature; | |
using GroupDocs.Signature.Domain; | |
using GroupDocs.Signature.Options; | |
using (Signature signature = new Signature("sample.pdf")) | |
{ | |
DigitalVerifyOptions options = new DigitalVerifyOptions("certificate.pfx") | |
{ | |
Comments = "Test comment" | |
}; | |
// verify document signatures | |
VerificationResult result = signature.Verify(options); | |
if (result.IsValid) | |
{ | |
Console.WriteLine("\nDocument was verified successfully!"); | |
} | |
else | |
{ | |
Console.WriteLine("\nDocument failed verification process."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment