@interncom/diplomatic 0.12.9 → 0.12.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  import { Enclave } from "../shared/crypto/enclave";
2
2
  import { type SealedMasterKey } from "../shared/seed";
3
- import type { ICrypto } from "../shared/types";
4
3
  import { type ValStat } from "../shared/valstat";
5
4
  import type { ISeedStore, SetSeedOpts } from "../types";
6
5
  import type { PrfRp } from "../shared/webauthn/prf";
@@ -21,7 +20,6 @@ export type PrfSeedMeta = {
21
20
  */
22
21
  export type PersistPrfSeedMeta = (meta: PrfSeedMeta | undefined) => void | Promise<void>;
23
22
  export type PrfSeedStoreOpts = PrfRp & {
24
- crypto: ICrypto;
25
23
  /**
26
24
  * Required durable write path for sealed master + salt + credId.
27
25
  * Protocol IDB implements this via {@link IDBSeedStore.persistPrfMeta}.
@@ -1,12 +1,10 @@
1
1
  import { Enclave } from "../shared/crypto/enclave";
2
- import type { ICrypto } from "../shared/types";
3
2
  import { type ValStat } from "../shared/valstat";
4
3
  import type { ISeedStore, SetSeedOpts } from "../types";
5
4
  import { type LargeBlobRp } from "./largeBlob";
6
5
  export { defaultWebAuthnRpId } from "./webauthn";
7
6
  export { LargeBlob, type LargeBlobCreateOpts, type LargeBlobRp, } from "./largeBlob";
8
7
  export type PasskeySeedStoreOpts = LargeBlobRp & {
9
- crypto: ICrypto;
10
8
  credId?: Uint8Array;
11
9
  };
12
10
  /**
@@ -55,13 +55,13 @@ export declare class Enclave {
55
55
  #private;
56
56
  private constructor();
57
57
  /** New enclave with a fresh 32-byte master seed. */
58
- static fromRandom(crypto: ICrypto): Promise<Enclave>;
58
+ static fromRandom(): Promise<Enclave>;
59
59
  /**
60
60
  * Construct from raw master seed bytes (import / bootstrap only).
61
61
  * Copies the seed so callers may zero their buffer after success.
62
62
  * Prefer {@link fromRandom} or {@link unsealWithPasskey} for normal flows.
63
63
  */
64
- static fromBytes(crypto: ICrypto, bytes: Uint8Array): ValStat<Enclave>;
64
+ static fromBytes(bytes: Uint8Array): ValStat<Enclave>;
65
65
  /**
66
66
  * UV + PRF ceremony, then AEAD-seal master. Returns sealed ciphertext + public
67
67
  * meta only — never PRF output. Sealed blob on disk is useless without a
@@ -75,7 +75,7 @@ export declare class Enclave {
75
75
  * Callers never supply PRF bytes — only sealed meta + RP/salt/credId.
76
76
  * Returns the credential id used so stores can persist it (skip picker next time).
77
77
  */
78
- static unsealWithPasskey(crypto: ICrypto, sealedMaster: SealedMasterKey, opts: PasskeyPrfOpts & {
78
+ static unsealWithPasskey(sealedMaster: SealedMasterKey, opts: PasskeyPrfOpts & {
79
79
  salt: Uint8Array;
80
80
  }): Promise<ValStat<{
81
81
  enclave: Enclave;
@@ -100,7 +100,7 @@ export declare class Enclave {
100
100
  * Pass `opts.credId` for a known credential; omit for discoverable assertion.
101
101
  * Returns the credential id used (useful after discover).
102
102
  */
103
- static fromLargeBlob(crypto: ICrypto, opts?: LargeBlobRp & {
103
+ static fromLargeBlob(opts?: LargeBlobRp & {
104
104
  credId?: Uint8Array;
105
105
  }): Promise<ValStat<{
106
106
  enclave: Enclave;
@@ -122,7 +122,7 @@ export declare class Enclave {
122
122
  * UV + PRF (using envelope salt/credId), decrypt pair body, build Enclave.
123
123
  * Also seals master under the same PRF for durable IDB (single ceremony).
124
124
  */
125
- static openPairPackageBody(crypto: ICrypto, body: Uint8Array, opts: PasskeyPrfOpts & {
125
+ static openPairPackageBody(body: Uint8Array, opts: PasskeyPrfOpts & {
126
126
  salt: Uint8Array;
127
127
  }): Promise<ValStat<{
128
128
  enclave: Enclave;
@@ -30,7 +30,5 @@ export declare class IDBSeedStore implements ISeedStore {
30
30
  hasPrfMeta(): Promise<boolean>;
31
31
  /** Last PRF passkey id, if this device has a sealed PRF identity. */
32
32
  lastPrfCredId(): Promise<Uint8Array | undefined>;
33
- openPrfStore(opts: Omit<PrfSeedStoreOpts, "crypto" | "persistMeta" | "meta"> & {
34
- crypto?: ICrypto;
35
- }): Promise<PrfSeedStore>;
33
+ openPrfStore(opts: Omit<PrfSeedStoreOpts, "persistMeta" | "meta">): Promise<PrfSeedStore>;
36
34
  }