Skip to content

G-Sign

Production · Layer 2 — Signing · Repo: sso-gerege-mn (gsign.gerege.mn/) · gsign.gerege.mn

The gateway for putting legally valid electronic signatures on documents. Written in Go, built on the signing service of eID Mongolia.

What it does

  • PAdES signatures — signs PDF documents server-side.
  • Timestamping — attests the moment of signing through an RFC 3161 TSA.
  • Sign-relay — lets third-party RPs have documents signed through the platform's own eID credentials.
  • Document-Signer certificates — long-lived certificates for signing on behalf of an organisation.

Two kinds of signature

Kind Who signs PIN Used for
Citizen signature The citizen personally PIN2 Contracts, applications, requests — expresses the will of an individual
Document-Signer The organisation (a system) Statements, certificates — attests the origin of a document

Do not conflate the two

A Document-Signer certificate does not express a citizen's will. Any document requiring the citizen's consent must carry a citizen signature made with PIN2. Interpreting a signature applied automatically by a system as the citizen's consent violates the principle of non-repudiation.

The signing flow

sequenceDiagram
    participant RP as RP app
    participant GS as G-Sign
    participant EID as eID Mongolia
    participant U as Citizen's phone
    participant TSA as TSA

    RP->>GS: PDF + request to sign
    GS->>EID: Start a signing session
    EID->>U: Push / QR — ask for PIN2
    U-->>EID: PIN2 approval
    Note over EID,U: 2-of-2 threshold ECDSA —<br/>both parties build the signature together
    EID-->>GS: Signature value
    GS->>TSA: Request a timestamp
    TSA-->>GS: RFC 3161 token
    GS-->>RP: Signed PDF (PAdES)

Verification

Verifying a signature means checking all three of the following:

  1. The mathematical validity of the signature — that the document has not been altered.
  2. The validity of the certificate — via OCSP/CRL, as it stood at the time of signing.
  3. The timestamp — proving through the TSA when the signature was made.

The third point matters: even if a certificate is revoked later, a signature made while it was valid remains valid. Without a timestamp that cannot be proven.

Who uses it

Full documentation

Implementation documentation lives in the gsign.gerege.mn/ directory of the sso-gerege-mn repository.