123456789_123456789_123456789_123456789_123456789_

Class: Mongo::Crypt::KMS::Azure::MasterKeyDocument Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
Inherits: Object
Defined in: lib/mongo/crypt/kms/azure/master_document.rb

Overview

::Mongo::Crypt::KMS::Azure KMS master key document object contains ::Mongo::Crypt::KMS master key parameters.

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::Mongo::Crypt::KMS::Validations - Included

#validate_param

Validate if a ::Mongo::Crypt::KMS parameter is valid.

#validate_tls_options

Validate KMS TLS options.

Instance Attribute Details

#key_nameString (readonly)

Returns:

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/azure/master_document.rb', line 32

attr_reader :key_name

#key_vault_endpointString (readonly)

Returns:

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/azure/master_document.rb', line 29

attr_reader :key_vault_endpoint

#key_versionString | nil (readonly)

Returns:

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/azure/master_document.rb', line 35

attr_reader :key_version

Instance Method Details

#to_documentBSON::Document

Convert master key document object to a BSON document in libmongocrypt format.

Returns:

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/azure/master_document.rb', line 63

def to_document
  BSON::Document.new({
    provider: 'azure',
    keyVaultEndpoint: key_vault_endpoint,
    keyName: key_name,
  }).tap do |bson|
    unless key_version.nil?
      bson.update({ keyVersion: key_version })
    end
  end
end