live · mainnetoc · docs
specs · api · guides
docs / documentation

@orangecheck/vault-core


@orangecheck/vault-core / OcVault

Class: OcVault

Defined in: vault-core/src/vault.ts:32

Properties

PropertyModifierTypeDescriptionDefined in
<a id="property-entries"></a> entriesreadonlyDecryptedEntry[]Every live (non-trashed) decrypted entry.vault-core/src/vault.ts:37
<a id="property-identity"></a> identityreadonlystring | nullThe OrangeCheck identity this vault belongs to, when known.vault-core/src/vault.ts:39
<a id="property-key"></a> keyreadonlyUint8ArrayThe unwrapped 32-byte vault key. In-memory only.vault-core/src/vault.ts:35

Methods

find()

find(item: string): DecryptedEntry | null;

Defined in: vault-core/src/vault.ts:105

Find one decrypted entry by its id or its name (case-insensitive).

Parameters

ParameterType
itemstring

Returns

DecryptedEntry | null


list()

list(): VaultEntrySummary[];

Defined in: vault-core/src/vault.ts:100

Metadata summaries for every entry — no secret values.

Returns

VaultEntrySummary[]


resolve()

resolve(ref: string | SecretRef): string;

Defined in: vault-core/src/vault.ts:115

Resolve one ocv:// reference to its value.

Parameters

ParameterType
refstring | SecretRef

Returns

string


resolveAll()

resolveAll(refs: Record<string, string>): Record<string, string>;

Defined in: vault-core/src/vault.ts:129

Resolve a map of { name: ocv://reference } to { name: value } — the shape an .env-style file or a CI matrix uses.

Parameters

ParameterType
refsRecord&lt;string, string>

Returns

Record&lt;string, string>


fromEntries()

static fromEntries(entries: VaultEntry[], key: Uint8Array): OcVault;

Defined in: vault-core/src/vault.ts:77

Open from entries and a raw key you already hold (e.g. the extension).

Parameters

ParameterType
entriesVaultEntry[]
keyUint8Array

Returns

OcVault


fromExport()

static fromExport(
   exportFile: string | VaultExport, 
   escrow: WrappedKey, 
   passphrase: string): OcVault;

Defined in: vault-core/src/vault.ts:63

Open from a portable export file — fully offline, no network. The export holds ciphertext only, so the escrowed WrappedKey and the passphrase are still required to derive the key.

Parameters

ParameterType
exportFilestring | VaultExport
escrowWrappedKey
passphrasestring

Returns

OcVault


open()

static open(opts: {
  client: VaultClient;
  passphrase: string;
}): Promise<OcVault>;

Defined in: vault-core/src/vault.ts:46

Open a live vault over a VaultClient: fetch the escrow, unwrap the key with the passphrase, pull every blob, decrypt.

Parameters

ParameterType
opts&#123; client: VaultClient; passphrase: string; &#125;
opts.clientVaultClient
opts.passphrasestring

Returns

Promise&lt;OcVault>