Table of Contents

Class AutoEncryptionOptions

Namespace
MongoDB.Driver.Encryption
Assembly
MongoDB.Driver.dll

Auto encryption options.

public class AutoEncryptionOptions
Inheritance
AutoEncryptionOptions
Inherited Members

Constructors

AutoEncryptionOptions(CollectionNamespace, IReadOnlyDictionary<string, IReadOnlyDictionary<string, object>>, Optional<bool>, Optional<IReadOnlyDictionary<string, object>>, Optional<IMongoClient>, Optional<IReadOnlyDictionary<string, BsonDocument>>, Optional<IReadOnlyDictionary<string, SslSettings>>, Optional<IReadOnlyDictionary<string, BsonDocument>>, Optional<bool?>)

Initializes a new instance of the AutoEncryptionOptions class.

public AutoEncryptionOptions(CollectionNamespace keyVaultNamespace, IReadOnlyDictionary<string, IReadOnlyDictionary<string, object>> kmsProviders, Optional<bool> bypassAutoEncryption = default, Optional<IReadOnlyDictionary<string, object>> extraOptions = default, Optional<IMongoClient> keyVaultClient = default, Optional<IReadOnlyDictionary<string, BsonDocument>> schemaMap = default, Optional<IReadOnlyDictionary<string, SslSettings>> tlsOptions = default, Optional<IReadOnlyDictionary<string, BsonDocument>> encryptedFieldsMap = default, Optional<bool?> bypassQueryAnalysis = default)

Parameters

keyVaultNamespace CollectionNamespace

The keyVault namespace.

kmsProviders IReadOnlyDictionary<string, IReadOnlyDictionary<string, object>>

The kms providers.

bypassAutoEncryption Optional<bool>

The bypass auto encryption flag.

extraOptions Optional<IReadOnlyDictionary<string, object>>

The extra options.

keyVaultClient Optional<IMongoClient>

The keyVault client.

schemaMap Optional<IReadOnlyDictionary<string, BsonDocument>>

The schema map.

tlsOptions Optional<IReadOnlyDictionary<string, SslSettings>>

The tls options.

encryptedFieldsMap Optional<IReadOnlyDictionary<string, BsonDocument>>

The encryptedFields map.

bypassQueryAnalysis Optional<bool?>

The bypass query analysis flag.

Properties

BypassAutoEncryption

Gets a value indicating whether to bypass automatic encryption.

public bool BypassAutoEncryption { get; }

Property Value

bool

true if automatic encryption should be bypasssed; otherwise, false.

BypassQueryAnalysis

Gets a value indicating whether to bypass query analysis.

public bool? BypassQueryAnalysis { get; }

Property Value

bool?

EncryptedFieldsMap

Gets the encrypted fields map. Supplying an encryptedFieldsMap provides more security than relying on an encryptedFields obtained from the server. It protects against a malicious server advertising a false encryptedFields.

public IReadOnlyDictionary<string, BsonDocument> EncryptedFieldsMap { get; }

Property Value

IReadOnlyDictionary<string, BsonDocument>

ExtraOptions

Gets the extra options.

public IReadOnlyDictionary<string, object> ExtraOptions { get; }

Property Value

IReadOnlyDictionary<string, object>

The extra options.

Remarks

All MongoClient objects in the same process should use the same setting for extraOptions.cryptSharedLibPath, as it is an error to load more that one crypt_shared dynamic library simultaneously in a single operating system process.

KeyVaultClient

Gets the key vault client.

public IMongoClient KeyVaultClient { get; }

Property Value

IMongoClient

The key vault client.

KeyVaultNamespace

Gets the key vault namespace.

public CollectionNamespace KeyVaultNamespace { get; }

Property Value

CollectionNamespace

The key vault namespace.

KmsProviders

Gets the KMS providers.

public IReadOnlyDictionary<string, IReadOnlyDictionary<string, object>> KmsProviders { get; }

Property Value

IReadOnlyDictionary<string, IReadOnlyDictionary<string, object>>

The KMS providers.

SchemaMap

Gets the schema map.

public IReadOnlyDictionary<string, BsonDocument> SchemaMap { get; }

Property Value

IReadOnlyDictionary<string, BsonDocument>

The schema map.

TlsOptions

Gets the tls options.

public IReadOnlyDictionary<string, SslSettings> TlsOptions { get; }

Property Value

IReadOnlyDictionary<string, SslSettings>

The tls options.

Methods

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

With(Optional<CollectionNamespace>, Optional<IReadOnlyDictionary<string, IReadOnlyDictionary<string, object>>>, Optional<bool>, Optional<bool?>, Optional<IReadOnlyDictionary<string, object>>, Optional<IMongoClient>, Optional<IReadOnlyDictionary<string, BsonDocument>>, Optional<IReadOnlyDictionary<string, SslSettings>>, Optional<IReadOnlyDictionary<string, BsonDocument>>)

Returns a new instance of the AutoEncryptionOptions class.

public AutoEncryptionOptions With(Optional<CollectionNamespace> keyVaultNamespace = default, Optional<IReadOnlyDictionary<string, IReadOnlyDictionary<string, object>>> kmsProviders = default, Optional<bool> bypassAutoEncryption = default, Optional<bool?> bypassQueryAnalysis = default, Optional<IReadOnlyDictionary<string, object>> extraOptions = default, Optional<IMongoClient> keyVaultClient = default, Optional<IReadOnlyDictionary<string, BsonDocument>> schemaMap = default, Optional<IReadOnlyDictionary<string, SslSettings>> tlsOptions = default, Optional<IReadOnlyDictionary<string, BsonDocument>> encryptedFieldsMap = default)

Parameters

keyVaultNamespace Optional<CollectionNamespace>

The keyVault namespace.

kmsProviders Optional<IReadOnlyDictionary<string, IReadOnlyDictionary<string, object>>>

The kms providers.

bypassAutoEncryption Optional<bool>

The bypass auto encryption flag.

bypassQueryAnalysis Optional<bool?>

The bypass query analysis flag.

extraOptions Optional<IReadOnlyDictionary<string, object>>

The extra options.

keyVaultClient Optional<IMongoClient>

The keyVault client.

schemaMap Optional<IReadOnlyDictionary<string, BsonDocument>>

The schema map.

tlsOptions Optional<IReadOnlyDictionary<string, SslSettings>>

The tls options.

encryptedFieldsMap Optional<IReadOnlyDictionary<string, BsonDocument>>

The encryptedFields map.

Returns

AutoEncryptionOptions

A new instance of AutoEncryptionOptions.