A Document Signed with a Demonstration Certificate

A contract sent by e-mail can be changed on the way — a figure, a date, a clause — and nothing on the page shows it. A digital signature is what shows it. It is a number worked out from every byte of the file with a private key, and reading software works it out again when the file is opened: if a single byte has moved, it says the signature is broken.

This document is signed with a certificate made only for this example, which names no person and no company. So the signature proves that the file has not changed, and nothing about who signed it, since nobody vouches for this certificate. The library never holds the key. It prepares everything around the signature and hands the one step that needs the key to a program of yours — here the free OpenSSL tool. The page prints every command that made the signature, and the one that checks it without this library.

What This Example Shows

  • A signature any change to the file breaks, in a framed box on the page that names the signer and the time of signing.
  • Every command that made the key, the certificate and the signature, printed on the page.
  • The command that checks the signature with OpenSSL alone.

The Source Code, Complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library.

Read the Rust source Read the Python source

The Document Itself

Open the document in English Open the document in French Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese

A Document Signed with a Demonstration Certificate, first page

The Same Document in Other Languages

This document weighs 20.0 kB

Examples Near This One

An Agreement Received and Added to without a Byte Moved

A maintenance agreement somebody else sent, with a signature area, a date and a line of one's own laid over its last page, an annex added after it and an empty place to sign over the signature area, every byte of the agreement left where it was.

A Template Whose Regions Are Filled by Name

A delivery label on which a designer named four rectangles, read back from its own file, placed four times and filled by those names alone: an address, an order number, a logo drawn from an SVG file and a return slip.

The Watermark a Trial Copy Carries

What you get before you pay anything: a watermark across every page, and the same pages under it, laid out exactly as a paid copy lays them out. This is also the document that says what a licence key changes, and why every figure on this site is measured with one.

An Interactive Form

A form a reader fills in: text boxes, a check box, a drop-down, radio buttons.

Every example, by subject