MONGOC_AUTO_E..._KMS_PROVIDERS(3)
β¨ SYNOPSIS β¨
okay so bestie, this is the MONGOC_AUTO_E..._KMS_PROVIDERS(3) page from libmongoc, and it's literally here to help you set KMS providers on your auto-encryption options. The function signature is:
void
mongoc_auto_encryption_opts_set_kms_providers (
mongoc_auto_encryption_opts_t *opts, const bson_t *kms_providers);
π PARAMETERS π
optsβ themongoc_auto_encryption_opts_t. That's the options struct you're handing over.kms_providersβ abson_tcontaining configuration for an external Key Management Service (KMS). Yes, the whole KMS moment lives in this BSON doc.
kms_providers is a BSON document containing configuration for each KMS provider. Think of it as the group chat of KMS configs, one entry per provider.
KMS providers are specified as a string of the form <KMS provider type> or <KMS provider type>:<KMS provider name>. The supported KMS provider types are aws, azure, gcp, local, and kmip. The optional name is the slay detail that enables configuring multiple KMS providers with the same KMS provider type (e.g. aws:name1 and aws:name2 can refer to different AWS accounts). At least one KMS provider must be specified.
β οΈ At least one KMS provider must be specified β no empty lineup, bestie.
Supported forms of the KMS provider type aws include:
aws: {
accessKeyId: String,
secretAccessKey: String
}
// To pass temporary credentials:
aws: {
accessKeyId: String,
secretAccessKey: String
sessionToken: String
}
// To request credentials from the environment:
aws: {}
Supported forms of the KMS provider type local include:
local: {
// key is used to encrypt/decrypt data keys:
key: "<96 byte BSON binary of subtype 0>" or String // May be passed as a base64 encoded string.
}
Supported forms of the KMS provider type azure include:
azure: {
tenantId: String,
clientId: String,
clientSecret: String,
identityPlatformEndpoint: Optional<String> // Defaults to login.microsoftonline.com
}
// To pass an accessToken directly:
azure: {
accessToken: String
}
// To request credentials from the environment:
azure: {}
Supported forms of the KMS provider type gcp include:
gcp: {
email: String,
privateKey: byte[] or String, // May be passed as a base64 encoded string.
endpoint: Optional<String> // Defaults to oauth2.googleapis.com
}
// To pass an accessToken directly:
gcp: {
accessToken: String
}
// To request credentials from the environment:
gcp: {}
Supported forms of the KMS provider type kmip include:
kmip: {
endpoint: String
}
KMS providers may include an optional name suffix separate with a colon. This enables configuring multiple KMS providers with the same KMS provider type. Example:
"aws:name1": {
accessKeyId: String,
secretAccessKey: String
},
"aws:name2": {
accessKeyId: String,
secretAccessKey: String
}
π SEE ALSO π
mongoc_client_enable_auto_encryption()- In-Use Encryption
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
xoxo bestie, stay encrypted π
β this page is from libmongoc version 2.5.6, dated Oct 09, 2026. π«Ά
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms