Skip to content

AuthProvider

Defined in: packages/core/src/auth-provider.ts:11

PrivateKey

PublicKey

DocumentKey = string

readonly nonceBytes: number

Defined in: packages/core/src/auth-provider.ts:31

Returns the nonce/IV size in bytes for the configured encryption algorithm.

decrypt(data, documentKey, nonce?): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/auth-provider.ts:22

Uint8Array

DocumentKey

Uint8Array<ArrayBufferLike>

Promise<Uint8Array<ArrayBufferLike>>


deserializePublicKey(serialized): Promise<PublicKey>

Defined in: packages/core/src/auth-provider.ts:66

Restore a public identity from the canonical representation produced by serializePublicKey. The result MUST round-trip to the exact same canonical string and MUST be detached from mutable objects owned by the caller of serializePublicKey (including nested aliases). Network invitation flows require this operation so the inviter can verify proof of possession from a previously unknown recipient and the recipient can pin the inviter named in the offer. Reader and writer membership changes round-trip every target identity through this codec before queueing so the queued target is detached from the caller.

string

Promise<PublicKey>


encrypt(data, documentKey): Promise<EncryptionResult>

Defined in: packages/core/src/auth-provider.ts:18

Uint8Array

DocumentKey

Promise<EncryptionResult>


serializePublicKey(publicKey): Promise<string>

Defined in: packages/core/src/auth-provider.ts:53

Serialize a PublicKey to a stable string representation. The representation MUST be canonical and collision-free for the provider’s identity domain: two keys serialize equally if and only if the provider treats them as the same identity. Two peers must therefore reach the same identity decision from the serialized strings.

Implementations MUST capture every caller-owned value needed for the encoding synchronously, before their first asynchronous suspension, and MUST NOT retain a mutable caller-owned object for later inspection. Role transitions snapshot identities before waiting for the document mutation queue; deferring the read until after an await would let the caller change which identity the queued operation targets.

This is used by the BeeKEM Welcome flow (recipient binding) and is intentionally generic so non-CryptoKey providers (e.g. opaque/hash-based identities) can supply their own canonical encoding. Membership changes use it to snapshot the target identity before they wait for the document mutation queue.

PublicKey

Promise<string>


sign(data, privateKey): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/auth-provider.ts:12

Uint8Array

PrivateKey

Promise<Uint8Array<ArrayBufferLike>>


verify(data, publicKey, signature): Promise<boolean>

Defined in: packages/core/src/auth-provider.ts:13

Uint8Array

PublicKey

Uint8Array

Promise<boolean>