Securing and signing PDF in C#

Contents
[ ]

This section describes how to securely digitally sign PDF documents using C#. The terms electronic signature and digital signature are used interchangeably, but essentially the two are different. More generally, a digital signature comes with a certification authority approved seal and is used to protect the signed document from tampering. Instead, an electronic signature is often used to demonstrate the intention to sign a document.

Aspose.PDF supports digital signatures:

  • PKCS1 with RSA signature algorithm and SHA-1 digest.
  • PKCS7 with RSA signature algorithm and SHA-1 digest.
  • PKCS7 detached with DSA, RSA and ECDSA signature algorithms. The supported digest algorithms depend on the signature algorithm.
  • Timestamp signature.

Digest algorithms for PKCS7 detached:

  • DSA - SHA-1.
  • RSA - SHA-1, SHA-256, SHA-384, SHA-512.
  • ECDSA - SHA-256, SHA-384, SHA-512, SHA3-256, SHA3-384, SHA3-512.

It is recommended to avoid digital signatures with the SHA-1 digest algorithm due to its insecurity.