@@ -109,7 +109,7 @@ def kms_request(self, kms_context):
109
109
message = kms_context .message
110
110
provider = kms_context .kms_provider
111
111
ctx = self .opts ._kms_ssl_contexts .get (provider )
112
- if not ctx :
112
+ if ctx is None :
113
113
# Enable strict certificate verification, OCSP, match hostname, and
114
114
# SNI using the system default CA certificates.
115
115
ctx = get_ssl_context (
@@ -378,9 +378,8 @@ def __init__(self, kms_providers, key_vault_namespace, key_vault_client,
378
378
See :ref:`explicit-client-side-encryption` for an example.
379
379
380
380
:Parameters:
381
- - `kms_providers`: Map of KMS provider options. Two KMS providers
382
- are supported: "aws" and "local". The kmsProviders map values
383
- differ by provider:
381
+ - `kms_providers`: Map of KMS provider options. The `kms_providers`
382
+ map values differ by provider:
384
383
385
384
- `aws`: Map with "accessKeyId" and "secretAccessKey" as strings.
386
385
These are the AWS access key ID and AWS secret access key used
@@ -396,6 +395,8 @@ def __init__(self, kms_providers, key_vault_namespace, key_vault_client,
396
395
Additionally, "endpoint" may also be specified as a string
397
396
(defaults to 'oauth2.googleapis.com'). These are the
398
397
credentials used to generate Google Cloud KMS messages.
398
+ - `kmip`: Map with "endpoint" as a host with required port.
399
+ For example: ``{"endpoint": "example.com:443"}``.
399
400
- `local`: Map with "key" as `bytes` (96 bytes in length) or
400
401
a base64 encoded string which decodes
401
402
to 96 bytes. "key" is the master key used to encrypt/decrypt
@@ -424,7 +425,7 @@ def __init__(self, kms_providers, key_vault_namespace, key_vault_client,
424
425
kms_tls_options={'kmip': {'tlsCAFile': certifi.where()}}
425
426
426
427
.. versionchanged:: 4.0
427
- Added the `kms_tls_options` parameter.
428
+ Added the `kms_tls_options` parameter and the "kmip" KMS provider .
428
429
429
430
.. versionadded:: 3.9
430
431
"""
@@ -458,7 +459,7 @@ def create_data_key(self, kms_provider, master_key=None,
458
459
459
460
:Parameters:
460
461
- `kms_provider`: The KMS provider to use. Supported values are
461
- "aws" and "local".
462
+ "aws", "azure", "gcp", "kmip", and "local".
462
463
- `master_key`: Identifies a KMS-specific key used to encrypt the
463
464
new data key. If the kmsProvider is "local" the `master_key` is
464
465
not applicable and may be omitted.
@@ -493,6 +494,16 @@ def create_data_key(self, kms_provider, master_key=None,
493
494
- `endpoint` (string): Optional. Host with optional port.
494
495
Defaults to "cloudkms.googleapis.com".
495
496
497
+ If the `kms_provider` is "kmip" it is optional and has the
498
+ following fields::
499
+
500
+ - `keyId` (string): Optional. `keyId` is the KMIP Unique
501
+ Identifier to a 96 byte KMIP Secret Data managed object. If
502
+ keyId is omitted, the driver creates a random 96 byte KMIP
503
+ Secret Data managed object.
504
+ - `endpoint` (string): Optional. Host with optional
505
+ port, e.g. "example.vault.azure.net:".
506
+
496
507
- `key_alt_names` (optional): An optional list of string alternate
497
508
names used to reference a key. If a key is created with alternate
498
509
names, then encryption may refer to the key by the unique alternate
0 commit comments