DAT
DAT is an ASCII string separated by dots (.). Each field appears exactly once in a fixed order, and the signature verifies that the preceding fields are exactly as transmitted.
expire.cid.plain.secure.signatureFields
| Field | Representation | Meaning |
|---|---|---|
expire | Decimal unsigned integer | Unix time when the DAT expires |
cid | Lowercase hexadecimal unsigned integer | Certificate ID used for verification |
plain | Unpadded Base64Url | Unencrypted bytes |
secure | Unpadded Base64Url | Bytes protected by the certificate's encryption algorithm |
signature | Unpadded Base64Url | Signature over the original ASCII bytes of expire.cid.plain.secure |
Because plain is covered by the signature, it cannot be altered, but anyone can decode it. Put secrets, personal data, and values used directly for authorization decisions in secure. An empty secure field is valid.
Canonical representation
- The entire DAT must be ASCII.
- Numbers are written without signs, spaces, prefixes, or unnecessary leading zeroes. Only the value zero is written as
0. - Base64Url uses the URL-safe alphabet and does not allow
=padding or whitespace. - Non-canonical Base64Url strings that represent the same bytes in multiple ways are rejected.
- A string with a different field count or order is not a DAT.
These rules prevent different implementations from accepting different strings as the same DAT.
Issuance
- Select a certificate that is currently issuable.
- Add the certificate's TTL to the current time to create
expire. - Encode
plainwith Base64Url. - Encrypt
securewith the certificate's encryption algorithm. - Join the preceding fields with dots and sign their ASCII bytes.
Issuance is allowed only within the certificate's issuance window: start <= now <= start + duration.
Verification
- Parse the DAT according to the canonical rules.
- Check that
expire > now. A DAT withexpire == nowis expired. - Find the certificate matching
cidand confirm that it remains valid for verification. - Verify the signature over the original
expire.cid.plain.securebytes. - Authenticate and decrypt
secure, then return it together withplain.
A parsing API that does not verify the signature is only for observation or diagnostics. Never use its output for authentication or authorization.
Responsibilities outside the specification
DAT does not define the user store, login method, authorization model, token transport header, or revocation list. The application decides which requests may use a verified payload.