IF Commons GitHub

logical/certificates

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-estate-endpoints-readers FR-007

Certificates, from the facts of one (read by the physical layer): an asset of the kind certificate, and the endpoints it secures: an endpoint that speaks over TLS whose host is one of the certificate's names (a wildcard name covers one label) is secured by it (secured-by).

import { names } from "./certificates.ts";
names({ subject: "a.example.test", names: ["*.example.test"], issuer: "ca", notAfter: "2027-01-01", key: "rsa-2048" }); // ["a.example.test", "*.example.test"]

Source: commons/estate-endpoints/src/logical/certificates.ts

3 of 10 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.CertFactstypeno test imports it
type CertFacts = { readonly subject: string; readonly names: readonly string[]; readonly issuer: string; readonly notAfter: string; readonly key: string };

What is read of a certificate.

logical.namesfunctionno test imports it
function names(c: CertFacts): readonly string[]

The names a certificate is valid for: its subject and its alternative names, without repeats.

logical.coversfunctionno test imports it
function covers(certName: string, host: string): boolean

Whether a name is covered by a certificate name (a wildcard covers exactly one label).

logical.importCertificatesfunctionno test imports it
function importCertificates(source: string, certs: readonly CertFacts[]): Found

The assets of the certificates, as read.

logical.securefunctionno test imports it
function secure(assets: readonly Imported[]): readonly ImportedLink[]

The links of the endpoints a certificate secures, among the assets given: a certificate is matched to the endpoints that speak over TLS to one of its names.

CertFactstypeno test imports it
type CertFacts = { readonly subject: string; readonly names: readonly string[]; readonly issuer: string; readonly notAfter: string; readonly key: string };

What is read of a certificate.

namesfunctionno test imports it
function names(c: CertFacts): readonly string[]

The names a certificate is valid for: its subject and its alternative names, without repeats.

coversfunction
function covers(certName: string, host: string): boolean

Whether a name is covered by a certificate name (a wildcard covers exactly one label).

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

importCertificatesfunction
function importCertificates(source: string, certs: readonly CertFacts[]): Found

The assets of the certificates, as read.

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

securefunction
function secure(assets: readonly Imported[]): readonly ImportedLink[]

The links of the endpoints a certificate secures, among the assets given: a certificate is matched to the endpoints that speak over TLS to one of its names.

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.