zibri
    Preparing search index...

    Interface for an encryption service.

    interface EncryptionServiceInterface {
        createKey: <TKey>(
            strategy: Newable<
                EncryptionStrategyInterface<
                    TKey,
                    BaseEncryptOptions<TKey>,
                    BaseDecryptOptions<TKey>,
                >,
            >,
            data: OmitStrict<EncryptionKeyCreateData, "strategy" | "value">,
            options?: BaseRepositoryOptions,
        ) => EncryptionKey | Promise<EncryptionKey>;
        decrypt: <TDecryptOptions extends BaseRepositoryOptions & AnyObject>(
            value: EncryptionString,
            options?: TDecryptOptions,
        ) => string | Promise<string>;
        decryptKey: <TKey>(
            strategy: Newable<
                EncryptionStrategyInterface<
                    TKey,
                    BaseEncryptOptions<TKey>,
                    BaseDecryptOptions<TKey>,
                >,
            >,
            encryptedKey: EncryptionString,
        ) => Promise<TKey>;
        deleteAllKeys: (
            where: Where<EncryptionKey>,
            options?: DeleteEncryptionKeyOptions,
        ) => void | Promise<void>;
        deleteKey: (
            keyId: string,
            options?: DeleteEncryptionKeyOptions,
        ) => void | Promise<void>;
        encrypt: <TKey, TEncryptOptions extends BaseEncryptOptions<TKey>>(
            value: string,
            options?: EncryptOptions<TKey, TEncryptOptions>,
        ) => EncryptionString | Promise<EncryptionString>;
        markKeyAsDefaultForStrategy: <TKey>(
            keyId: string,
            strategy: Newable<
                EncryptionStrategyInterface<
                    TKey,
                    BaseEncryptOptions<TKey>,
                    BaseDecryptOptions<TKey>,
                >,
            >,
            options?: BaseRepositoryOptions,
        ) => void | Promise<void>;
        needsReEncryption: (
            encrypted: EncryptionString,
        ) => boolean | Promise<boolean>;
    }

    Implemented by

    Index

    Properties

    createKey: <TKey>(
        strategy: Newable<
            EncryptionStrategyInterface<
                TKey,
                BaseEncryptOptions<TKey>,
                BaseDecryptOptions<TKey>,
            >,
        >,
        data: OmitStrict<EncryptionKeyCreateData, "strategy" | "value">,
        options?: BaseRepositoryOptions,
    ) => EncryptionKey | Promise<EncryptionKey>

    Creates a new encryption key for the given strategy.

    decrypt: <TDecryptOptions extends BaseRepositoryOptions & AnyObject>(
        value: EncryptionString,
        options?: TDecryptOptions,
    ) => string | Promise<string>

    Decrypts the given value using the provided options.

    decryptKey: <TKey>(
        strategy: Newable<
            EncryptionStrategyInterface<
                TKey,
                BaseEncryptOptions<TKey>,
                BaseDecryptOptions<TKey>,
            >,
        >,
        encryptedKey: EncryptionString,
    ) => Promise<TKey>

    Decrypts the key of the given strategy.

    deleteAllKeys: (
        where: Where<EncryptionKey>,
        options?: DeleteEncryptionKeyOptions,
    ) => void | Promise<void>

    Deletes all keys that match the given where clause.

    deleteKey: (
        keyId: string,
        options?: DeleteEncryptionKeyOptions,
    ) => void | Promise<void>

    Deletes the key with the given id.

    encrypt: <TKey, TEncryptOptions extends BaseEncryptOptions<TKey>>(
        value: string,
        options?: EncryptOptions<TKey, TEncryptOptions>,
    ) => EncryptionString | Promise<EncryptionString>

    Encrypts the given value using the provided options.

    markKeyAsDefaultForStrategy: <TKey>(
        keyId: string,
        strategy: Newable<
            EncryptionStrategyInterface<
                TKey,
                BaseEncryptOptions<TKey>,
                BaseDecryptOptions<TKey>,
            >,
        >,
        options?: BaseRepositoryOptions,
    ) => void | Promise<void>

    Marks the key with the given id as the default key for the given strategy.

    needsReEncryption: (encrypted: EncryptionString) => boolean | Promise<boolean>

    Checks whether or not the given encryption string should be re-encrypted.