In today’s digital age, ensuring the authenticity and integrity of electronic documents is crucial. One highly effective method for achieving this is through the use of digital signatures. In this guide, we will explore the world of digital signatures, explaining what they are, why they are essential, and how you can utilize GroupDocs.Signature to seamlessly eSign your documents.
What is a Digital Signature?
A digital signature is a cryptographic mechanism for verifying the authenticity and integrity of electronic documents. It provides strong assurance that the document originated from a known sender and has not been tampered with by unauthorized sources. Digital signatures are typically represented by certificates containing private (for signing) and public (for verification) keys. Various public key cryptography standards, such as PFX format, are commonly used for this purpose.
The picture below shows how a digital signature looks on a PDF document page by default.
Why Use Digital Signatures?
Enhanced Security: Digital signatures provide a higher level of document security, making it extremely challenging for unauthorized parties to alter the content.
Authentication: They offer a reliable way to verify the identity of the document sender.
Non-repudiation: Digital signatures prevent senders from denying the authenticity of the signed document.
How to Sign a document with a Digital Signature
GroupDocs.Signature supports the creation of digital signatures based on existing PFX certificates. To specify various settings the library provides the DigitalSignOptions class that allows adjusting digital signature properties in the document:
The FilePath or Stream properties define the certificate source;
The password property specifies the certificate password;
The example below shows how to sign a PDF document with a digital e-signature using C# language. We can sign any other supported document format in the same way.
using(Signaturesignature=newSignature("sample.pdf")){// initialize digital option with certificate file pathDigitalSignOptionsoptions=newDigitalSignOptions("certificate.pfx"){// optional: setup image file pathImageFilePath="sample.jpg",// set signature positionLeft=100,Top=100,// setPassword="1234567890"};signature.Sign("sampleSigned.pdf",options);}
Advanced Usage Topics
To learn more about document eSign features, please refer to the advanced usage section.
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: