ssign Version française

How ssign works, and what it does with your secrets

ssign is an independent client for the SimplySign cloud signing service. Here is what leaves your machine, what is kept on disk, and what to protect.

What is sent where

DestinationWhat ssign sends
cloudsign.webnotarius.pl
HTTPS
  • Login: your e-mail and the current 6-digit code, plus the OAuth client identifiers of the SimplySign web login. These identifiers are application-level constants, identical for every SimplySign Desktop user, not your secret.
  • Then, with the bearer token it received: the request for your card and certificate, and for each signature a SHA-256 digest computed on your machine together with your signing certificate.
Timestamp server
http://time.certum.pl/ by default, changed with --timestamp-url
An RFC 3161 request carrying the SHA-256 hash of the signature.
NobodyYour files, which are hashed locally, and your TOTP seed, from which the code is computed locally.

HTTPS certificates are checked through the operating system's trust store.

The login and the key

The TOTP seed is a long-lived secret

-O/--otp (environment variable CERTUM_OTP) is your TOTP seed, the base32 secret behind your authenticator. It is long-lived: anyone who has it and your e-mail can sign code as you, indefinitely, until you re-issue the SimplySign QR code. Treat it like a private key.

The account e-mail is not sensitive. The 6-digit code expires in about 30 seconds and is low-risk.

In memory, the command keeps the seed or code in a buffer that is wiped when it is no longer needed. That cannot undo an exposure that happens before ssign starts: a value passed as --otp is visible in /proc/<pid>/cmdline, and one passed through CERTUM_OTP in /proc/<pid>/environ.

The session cache

To avoid a second login (Certum accepts each code only once), the ssign command and the PKCS#11 module save the session after logging in, and reuse it on the next runs.

Whoever can read session.json can sign as you until the token expires. On a shared machine, keep that in mind.

What the signature contains

ssign builds a standard Authenticode PKCS#7 SignedData: the file's Authenticode SHA-256 hash, the signing time, the optional description and URL (-n, -u), the RSA signature from the cloud, your certificate and the Certum “Code Signing 2021 CA” intermediate, and the RFC 3161 timestamp token. It is embedded in the PE certificate table and the PE checksum is updated. The digest sent to the cloud is the SHA-256 of the signed attributes that carry the file's hash.

The SimplySign protocol

ssign speaks the cloud protocol directly:

  1. Certum cloudLog inOAuth login with your e-mail and a 6-digit one-time code → bearer token
  2. Certum cloudFetch the cardcard serial and signing certificate
  3. Your machineHashAuthenticode SHA-256 of each file
  4. Certum cloudRequest the signaturethe digest and the certificate → asynchronous task
  5. Certum cloudPoll→ RSA-4096 signature
  6. Your machineAssemble and embedPKCS#7 + certificate chain + RFC 3161 timestamp, written into the file

The protocol was reverse-engineered from the author's own licensed SimplySign Desktop 2.9.14 install, for interoperability, with a redacting proxy that recorded the structure of the requests and masked every value: no token, code, PIN or signature was written to disk. The whole flow is plain HTTPS, with no cryptographic activation step: session control is the OAuth bearer token. SimplySign Desktop's own PKCS#11 module is a thin shim that relays to the running desktop application, which is why it cannot sign on its own. The full reference, endpoints and dead ends: docs/simplysign-protocol.md.