IF Commons GitHub

physical/signing

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0005-evidence-capture-views FR-007, 0005-evidence-capture-views FR-008

Sealing and exporting with a signer of the fleet (0005-evidence-capture-views FR-007, FR-008): which signer a key file is (the one whose public key is the key file's, and, where the policy names one for the seal, only that one), the seal of the journal, the export of a bundle (refused unsigned where the policy asks for a seal with an export), the seals of the journal against the signers, and the verification of a bundle offline with the signers of a file or the bundle's own. Where the signers are kept is the caller's.

import { readSignersFile } from "./signing.ts";
// await readSignersFile("signers.json") is a Result of the list of { name, role, key }

Source: commons/evidence-capture/src/physical/signing.ts

5 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.

physical.sealWithfunctionno test imports it
function sealWith(store: GitRefStore, policy: CapturePolicy, signers: readonly TrustedSigner[], o: { readonly fleet: string; readonly keyFile: string; readonly agent: boolean; readonly now: string; }): Promise<Result<{ readonly seq: number; readonly head: string; readonly signer: string; }, string>>

Seals the journal of a fleet with a key of one of its signers, made at the instant.

physical.exportWithfunctionno test imports it
function exportWith(store: GitRefStore, policy: CapturePolicy, signers: readonly TrustedSigner[], o: { readonly fleet: string; readonly out: string; readonly until: string; readonly keyFile: string; readonly agent: boolean; readonly now: string; }): Promise<Result<Exported, string>>

Exports the journal up to an instant as a bundle; the policy that asks for a seal with an export refuses an unsigned one.

physical.readSignersFilefunctionno test imports it
function readSignersFile(file: string): Promise<Result<readonly TrustedSigner[], string>>

The signers a file lists: a JSON array of { name, role, key }, or an object with signers.

physical.verifyBundleAtfunctionno test imports it
function verifyBundleAt(dir: string, signersFile: string, at: string): Promise<Result<Verified, string>>

Verifies a bundle offline: with the signers of a file, or with its own where no file is given.

physical.sealsOffunctionno test imports it
function sealsOf(store: GitRefStore, policy: CapturePolicy, signers: readonly TrustedSigner[]): Promise<Result<{ readonly status: SealStatus; readonly lastSealedAt: string | undefined; readonly required: string; }, string>>

The seals of a fleet's journal against its signers, and when the last good seal was made.

sealWithfunction
function sealWith(store: GitRefStore, policy: CapturePolicy, signers: readonly TrustedSigner[], o: { readonly fleet: string; readonly keyFile: string; readonly agent: boolean; readonly now: string; }): Promise<Result<{ readonly seq: number; readonly head: string; readonly signer: string; }, string>>

Seals the journal of a fleet with a key of one of its signers, made at the instant.

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

exportWithfunction
function exportWith(store: GitRefStore, policy: CapturePolicy, signers: readonly TrustedSigner[], o: { readonly fleet: string; readonly out: string; readonly until: string; readonly keyFile: string; readonly agent: boolean; readonly now: string; }): Promise<Result<Exported, string>>

Exports the journal up to an instant as a bundle; the policy that asks for a seal with an export refuses an unsigned one.

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

readSignersFilefunction
function readSignersFile(file: string): Promise<Result<readonly TrustedSigner[], string>>

The signers a file lists: a JSON array of { name, role, key }, or an object with signers.

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

verifyBundleAtfunction
function verifyBundleAt(dir: string, signersFile: string, at: string): Promise<Result<Verified, string>>

Verifies a bundle offline: with the signers of a file, or with its own where no file is given.

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

sealsOffunction
function sealsOf(store: GitRefStore, policy: CapturePolicy, signers: readonly TrustedSigner[]): Promise<Result<{ readonly status: SealStatus; readonly lastSealedAt: string | undefined; readonly required: string; }, string>>

The seals of a fleet's journal against its signers, and when the last good seal was made.

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

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