fingerprinttextrequiredThe SHA-256 thumbprint of the certificate, unique; it is also the value mutual TLS binds a token to
Becomes the column fingerprint of certificate.
Written at commons/data/models/identity-pki/mod.ts:36
A certificate that a principal proves itself with: only the public half is kept
Model identityPki. Written in commons/data/models/identity-pki/mod.ts:33. Identified by credential.
fingerprinttextrequiredThe SHA-256 thumbprint of the certificate, unique; it is also the value mutual TLS binds a token to
Becomes the column fingerprint of certificate.
Written at commons/data/models/identity-pki/mod.ts:36
keyAlgorithmtextrequiredThe algorithm of its key
Becomes the column key_algorithm of certificate.
Written at commons/data/models/identity-pki/mod.ts:43
notAfterinstantrequiredWhen it stops
Becomes the column not_after of certificate.
Written at commons/data/models/identity-pki/mod.ts:42
notBeforeinstantrequiredWhen the certificate starts to be valid
Becomes the column not_before of certificate.
Written at commons/data/models/identity-pki/mod.ts:41
revokedReasontextoptionalWhy it was revoked, where it was
Becomes the column revoked_reason of certificate.
Written at commons/data/models/identity-pki/mod.ts:44
sanDnstextmanyThe domain names in the certificate's alternative name
Becomes the column san_dns of certificate.
Written at commons/data/models/identity-pki/mod.ts:40
sanUritextoptionalThe identifier in the certificate's alternative name, such as a SPIFFE ID
Becomes the column san_uri of certificate.
Written at commons/data/models/identity-pki/mod.ts:39
serialtextrequiredThe certificate's serial number
Becomes the column serial of certificate.
Written at commons/data/models/identity-pki/mod.ts:37
subjectNametextrequiredThe name the certificate is for
Becomes the column subject_name of certificate.
Written at commons/data/models/identity-pki/mod.ts:38
credentialoneThe credential it is To credential. Written at commons/data/models/identity-pki/mod.ts:33
issueroptionalThe anchor that vouches for it To trustAnchor. Written at commons/data/models/identity-pki/mod.ts:33
Projects to the table certificate with the primary key credential_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
credential_id | text | false | reference | certificate.credential |
fingerprint | text | false | attribute | certificate.fingerprint |
issuer_trust_anchor_id | text | true | reference | certificate.issuer |
key_algorithm | text | false | attribute | certificate.keyAlgorithm |
not_after | timestamp | false | attribute | certificate.notAfter |
not_before | timestamp | false | attribute | certificate.notBefore |
revoked_reason | text | true | attribute | certificate.revokedReason |
san_uri | text | true | attribute | certificate.sanUri |
serial | text | false | attribute | certificate.serial |
subject_name | text | false | attribute | certificate.subjectName |
CREATE TABLE IF NOT EXISTS "certificate" (
"credential_id" VARCHAR NOT NULL PRIMARY KEY,
"fingerprint" VARCHAR NOT NULL,
"serial" VARCHAR NOT NULL,
"subject_name" VARCHAR NOT NULL,
"san_uri" VARCHAR,
"not_before" TIMESTAMPTZ NOT NULL,
"not_after" TIMESTAMPTZ NOT NULL,
"key_algorithm" VARCHAR NOT NULL,
"revoked_reason" VARCHAR,
"issuer_trust_anchor_id" VARCHAR,
CONSTRAINT "certificate_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "credential" ("credential_id"),
CONSTRAINT "certificate_issuer_trust_anchor_id_fk" FOREIGN KEY ("issuer_trust_anchor_id") REFERENCES "trust_anchor" ("trust_anchor_id"),
CONSTRAINT "certificate_fingerprint_uq" UNIQUE ("fingerprint")
);CREATE TABLE IF NOT EXISTS "certificate" (
"credential_id" TEXT NOT NULL PRIMARY KEY,
"fingerprint" TEXT NOT NULL,
"serial" TEXT NOT NULL,
"subject_name" TEXT NOT NULL,
"san_uri" TEXT,
"not_before" TIMESTAMPTZ NOT NULL,
"not_after" TIMESTAMPTZ NOT NULL,
"key_algorithm" TEXT NOT NULL,
"revoked_reason" TEXT,
"issuer_trust_anchor_id" TEXT,
CONSTRAINT "certificate_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "credential" ("credential_id"),
CONSTRAINT "certificate_issuer_trust_anchor_id_fk" FOREIGN KEY ("issuer_trust_anchor_id") REFERENCES "trust_anchor" ("trust_anchor_id"),
CONSTRAINT "certificate_fingerprint_uq" UNIQUE ("fingerprint")
);CREATE TABLE IF NOT EXISTS "certificate" (
"credential_id" TEXT NOT NULL PRIMARY KEY,
"fingerprint" TEXT NOT NULL,
"serial" TEXT NOT NULL,
"subject_name" TEXT NOT NULL,
"san_uri" TEXT,
"not_before" TEXT NOT NULL,
"not_after" TEXT NOT NULL,
"key_algorithm" TEXT NOT NULL,
"revoked_reason" TEXT,
"issuer_trust_anchor_id" TEXT,
CONSTRAINT "certificate_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "credential" ("credential_id"),
CONSTRAINT "certificate_issuer_trust_anchor_id_fk" FOREIGN KEY ("issuer_trust_anchor_id") REFERENCES "trust_anchor" ("trust_anchor_id"),
CONSTRAINT "certificate_fingerprint_uq" UNIQUE ("fingerprint")
);Read and written from TypeScript with the types the model gives: import { certificate } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-pki.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { certificate } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(certificate).select((s) => ({ credentialId: s.certificate.credentialId, fingerprint: s.certificate.fingerprint })).run(runner);