EventLogEncryption.ts
EventLogEncryption.ts overview
Section titled “EventLogEncryption.ts overview”Cryptographic service for encrypted event-log replication.
EventLogEncryption turns local journal entries into encrypted remote
payloads and decrypts encrypted changes received from a server. It also
hashes byte data and creates event-log identities, so remote replication can
use storage or transport that should not see plaintext event data.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”encryption
Section titled “encryption”layerSubtle
Section titled “layerSubtle”Provides EventLogEncryption using globalThis.crypto.
Signature
declare const layerSubtle: Layer.Layer<EventLogEncryption, never, never>Since v4.0.0
makeEncryptionSubtle
Section titled “makeEncryptionSubtle”Creates an EventLogEncryption service backed by the Web Crypto SubtleCrypto
APIs from the supplied Crypto implementation.
Signature
declare const makeEncryptionSubtle: (crypto: Crypto) => Effect.Effect<EventLogEncryption["Service"]>Since v4.0.0
models
Section titled “models”EncryptedEntry
Section titled “EncryptedEntry”Schema for an encrypted journal entry paired with the id of the original entry.
Signature
declare const EncryptedEntry: Schema.Struct<{ readonly entryId: Schema.brand< Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, "effect/eventlog/EventJournal/EntryId" > readonly encryptedEntry: Transferable.Transferable< Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>> >}>Since v4.0.0
EncryptedRemoteEntry
Section titled “EncryptedRemoteEntry”Schema for encrypted entries exchanged with a remote event-log server.
Signature
declare const EncryptedRemoteEntry: Schema.Struct<{ readonly sequence: Schema.Number readonly iv: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>> readonly entryId: Schema.brand< Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, "effect/eventlog/EventJournal/EntryId" > readonly encryptedEntry: Transferable.Transferable< Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>> >}>Since v4.0.0
EncryptedRemoteEntry (interface)
Section titled “EncryptedRemoteEntry (interface)”Type of an encrypted remote entry, including its remote sequence number, initialization vector, entry id, and encrypted entry bytes.
Signature
export interface EncryptedRemoteEntry extends Schema.Schema.Type<typeof EncryptedRemoteEntry> {}Since v4.0.0
services
Section titled “services”EventLogEncryption (class)
Section titled “EventLogEncryption (class)”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.
Signature
declare class EventLogEncryptionSince v4.0.0