ClientEncryptionCreateEncryptedCollectionAsync Method (IMongoDatabase, String, CreateCollectionOptions, String, DataKeyOptions, CancellationToken) |
Note: This API is now obsolete.
Create encrypted collection.
Namespace:
MongoDB.Driver.Encryption
Assembly:
MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.20.0+ee01960089f28ea1b501690df5fc9f6318a70242
Syntax [ObsoleteAttribute("Use the overload with masterKey instead.")]
public Task<CreateEncryptedCollectionResult> CreateEncryptedCollectionAsync(
IMongoDatabase database,
string collectionName,
CreateCollectionOptions createCollectionOptions,
string kmsProvider,
DataKeyOptions dataKeyOptions,
CancellationToken cancellationToken = null
)
<ObsoleteAttribute("Use the overload with masterKey instead.")>
Public Function CreateEncryptedCollectionAsync (
database As IMongoDatabase,
collectionName As String,
createCollectionOptions As CreateCollectionOptions,
kmsProvider As String,
dataKeyOptions As DataKeyOptions,
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of CreateEncryptedCollectionResult)
[<ObsoleteAttribute("Use the overload with masterKey instead.")>]
member CreateEncryptedCollectionAsync :
database : IMongoDatabase *
collectionName : string *
createCollectionOptions : CreateCollectionOptions *
kmsProvider : string *
dataKeyOptions : DataKeyOptions *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken null
*)
-> Task<CreateEncryptedCollectionResult>
Parameters
- database
- Type: MongoDB.DriverIMongoDatabase
The database. - collectionName
- Type: SystemString
The collection name. - createCollectionOptions
- Type: MongoDB.DriverCreateCollectionOptions
The create collection options. - kmsProvider
- Type: SystemString
The kms provider. - dataKeyOptions
- Type: MongoDB.Driver.EncryptionDataKeyOptions
The datakey options. - cancellationToken (Optional)
- Type: System.ThreadingCancellationToken
The cancellation token.
Return Value
Type:
TaskCreateEncryptedCollectionResultThe operation result.
Remarks
If EncryptionFields contains a keyId with a null value, a data key will be automatically generated and returned in
EncryptedFields.
See Also