import * as Context from "../Context.ts"; import * as Effect from "../Effect.ts"; import * as Layer from "../Layer.ts"; import * as Schema from "../Schema.ts"; import * as Transferable from "../workers/Transferable.ts"; import { type Entry, RemoteEntry } from "./EventJournal.ts"; import type { Identity } from "./EventLog.ts"; /** * Schema for a batch of journal entries encrypted as one AES-GCM message. * * **Details** * * `entryIds` lists the ids of the encrypted entries in order. It is sent in * plaintext so the server can deduplicate batches, and it is authenticated * together with the store id, so a server cannot alter it or move the batch to * another store. * * @stability unstable * @category models * @since 4.0.0 */ export declare const EncryptedBatch: Schema.Struct<{ readonly entryIds: Schema.NonEmptyArray, Uint8Array>, "effect/eventlog/EventJournal/EntryId">>; readonly iv: Transferable.Transferable, Uint8Array>>; readonly encryptedBatch: Transferable.Transferable, Uint8Array>>; }>; /** * Type of an encrypted batch. * * @stability unstable * @category models * @since 4.0.0 */ export interface EncryptedBatch extends Schema.Schema.Type { } /** * Type of an encrypted batch stored by a remote server, including the remote * sequence of its first entry. * * @stability unstable * @category models * @since 4.0.0 */ export interface EncryptedRemoteBatch extends Schema.Schema.Type { } /** * Schema for encrypted batches exchanged with a remote event-log server. * * **Details** * * The entries of a batch have consecutive remote sequences starting at * `sequence`. * * @stability unstable * @category models * @since 4.0.0 */ export declare const EncryptedRemoteBatch: Schema.Struct<{ readonly entryIds: Schema.NonEmptyArray, Uint8Array>, "effect/eventlog/EventJournal/EntryId">>; readonly iv: Transferable.Transferable, Uint8Array>>; readonly encryptedBatch: Transferable.Transferable, Uint8Array>>; readonly sequence: Schema.Natural; }>; declare const EventLogEncryption_base: Context.ServiceClass) => Effect.Effect>; readonly decrypt: (identity: Identity["Service"], storeId: string, batches: ReadonlyArray) => Effect.Effect>; readonly sha256String: (data: Uint8Array) => Effect.Effect; readonly sha256: (data: Uint8Array) => Effect.Effect; readonly generateIdentity: Effect.Effect; }>; /** * Service that provides identity generation, entry * encryption and decryption, and SHA-256 hashing for event-log replication. * * **When to use** * * Use to provide cryptographic operations required by encrypted event-log * replication. * * @stability unstable * @category services * @since 4.0.0 */ export declare class EventLogEncryption extends EventLogEncryption_base { } /** * Creates an `EventLogEncryption` service backed by the Web Crypto `SubtleCrypto` * APIs from the supplied `Crypto` implementation. * * @stability unstable * @category encryption * @since 4.0.0 */ export declare const makeEncryptionSubtle: (crypto: Crypto) => Effect.Effect; /** * Provides `EventLogEncryption` using `globalThis.crypto`. * * @stability unstable * @category layers * @since 4.0.0 */ export declare const layerSubtle: Layer.Layer; export {}; //# sourceMappingURL=EventLogEncryption.d.ts.map