import { ShellApiWithMongoClass } from './decorators'; import type { ClientEncryption as MongoCryptClientEncryption, ClientEncryptionDataKeyProvider, ClientEncryptionEncryptOptions, ClientEncryptionTlsOptions, KMSProviders, AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, GCPEncryptionKeyOptions } from '@mongosh/service-provider-core'; import type { Document, BinaryType } from '@mongosh/service-provider-core'; import type { CollectionWithSchema } from './collection'; import Cursor from './cursor'; import type { DeleteResult } from './result'; import { asPrintable } from './enums'; import type Mongo from './mongo'; import type { CreateEncryptedCollectionOptions } from '@mongosh/service-provider-core'; export interface ClientSideFieldLevelEncryptionOptions { keyVaultClient?: Mongo; keyVaultNamespace: string; kmsProviders: KMSProviders; schemaMap?: Document; bypassAutoEncryption?: boolean; explicitEncryptionOnly?: boolean; tlsOptions?: { [k in keyof KMSProviders]?: ClientEncryptionTlsOptions; }; encryptedFieldsMap?: Document; bypassQueryAnalysis?: boolean; } type MasterKey = AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions; type AltNames = string[]; type DataKeyEncryptionKeyOptions = { masterKey?: MasterKey; keyAltNames?: AltNames; keyMaterial?: Buffer | BinaryType; }; export declare class ClientEncryption extends ShellApiWithMongoClass { _mongo: Mongo; _libmongocrypt: MongoCryptClientEncryption; constructor(mongo: Mongo); [asPrintable](): string; encrypt(keyId: BinaryType, value: any, algorithmOrEncryptionOptions: ClientEncryptionEncryptOptions['algorithm'] | ClientEncryptionEncryptOptions): Promise; decrypt(encryptedValue: BinaryType): Promise; encryptExpression(keyId: BinaryType, value: Document, options: ClientEncryptionEncryptOptions): Promise; createEncryptedCollection(dbName: string, collName: string, options: CreateEncryptedCollectionOptions): Promise<{ collection: CollectionWithSchema; encryptedFields: Document; }>; } export declare class KeyVault extends ShellApiWithMongoClass { _mongo: Mongo; _clientEncryption: ClientEncryption; private _keyColl; constructor(clientEncryption: ClientEncryption); _init(): Promise; [asPrintable](): string; createKey(kms: 'local', keyAltNames?: string[]): Promise; createKey(kms: ClientEncryptionDataKeyProvider, legacyMasterKey: string, keyAltNames?: string[]): Promise; createKey(kms: ClientEncryptionDataKeyProvider, options: MasterKey | DataKeyEncryptionKeyOptions | undefined): Promise; createKey(kms: ClientEncryptionDataKeyProvider, options: MasterKey | DataKeyEncryptionKeyOptions | undefined, keyAltNames: string[]): Promise; getKey(keyId: BinaryType): Promise; getKeyByAltName(keyAltName: string): Promise; getKeys(): Promise; deleteKey(keyId: BinaryType): Promise; addKeyAlternateName(keyId: BinaryType, keyAltName: string): Promise; removeKeyAlternateName(keyId: BinaryType, keyAltName: string): Promise; rewrapManyDataKey(filter: Document, options?: Document): Promise; createDataKey(...args: Parameters): ReturnType; removeKeyAltName(...args: Parameters): ReturnType; addKeyAltName(...args: Parameters): ReturnType; } export {};