Method: Mongo::Crypt::KMS::KMIP::MasterKeyDocument#initialize

Defined in:
lib/mongo/crypt/kms/kmip.rb

#initialize(opts = {}) ⇒ MasterKeyDocument

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates a master key document object form a parameters hash.

Parameters:

  • opts (Hash) (defaults to: {})

    A hash that contains master key options for KMIP KMS provider

Options Hash (opts):

  • :key_id (String | nil)

    KMIP Unique Identifier to a 96 byte KMIP Secret Data managed object, optional. If key_id is omitted, the driver creates a random 96 byte identifier.

  • :endpoint (String | nil)

    KMIP endpoint, optional.

Raises:

  • (ArgumentError)

    If required options are missing or incorrectly formatted.



92
93
94
95
96
97
98
99
# File 'lib/mongo/crypt/kms/kmip.rb', line 92

def initialize(opts = {})
  @key_id = validate_param(
    :key_id, opts, FORMAT_HINT, required: false
  )
  @endpoint = validate_param(
    :endpoint, opts, FORMAT_HINT, required: false
  )
end