zibri
    Preparing search index...

    Interface EncryptionStrategyInterface<TKey, TEncryptOptions, TDecryptOptions>

    Interface for an encryption strategy.

    interface EncryptionStrategyInterface<
        TKey,
        TEncryptOptions extends BaseEncryptOptions<TKey> = BaseEncryptOptions<TKey>,
        TDecryptOptions extends BaseDecryptOptions<TKey> = BaseDecryptOptions<TKey>,
    > {
        decrypt: (
            value: EncryptionString,
            options: TDecryptOptions,
        ) => string | Promise<string>;
        deserializeKey: (raw: Buffer) => TKey | Promise<TKey>;
        encrypt: (
            value: string,
            options: TEncryptOptions,
        ) => EncryptionString | Promise<EncryptionString>;
        generateRandomKey: () => TKey | Promise<TKey>;
        name: string;
        serializeKey: (
            key: TKey,
        ) => Buffer<ArrayBufferLike> | Promise<Buffer<ArrayBufferLike>>;
        version: string;
    }

    Type Parameters

    Implemented by

    Index

    Properties

    decrypt: (
        value: EncryptionString,
        options: TDecryptOptions,
    ) => string | Promise<string>

    Decrypts the given value with the given options.

    deserializeKey: (raw: Buffer) => TKey | Promise<TKey>

    Resolves a key from the given Buffer.

    encrypt: (
        value: string,
        options: TEncryptOptions,
    ) => EncryptionString | Promise<EncryptionString>

    Encrypts the given value with the given options.

    generateRandomKey: () => TKey | Promise<TKey>

    Generates a new random key.

    name: string

    The name of the strategy.

    serializeKey: (
        key: TKey,
    ) => Buffer<ArrayBufferLike> | Promise<Buffer<ArrayBufferLike>>

    Serializes the given key into a Buffer.

    version: string

    The version of the strategy.