Method: Mongo::Crypt::KMS::Local::Credentials#to_document

Defined in:
lib/mongo/crypt/kms/local/credentials.rb

#to_documentBSON::Document

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.

Returns Local KMS credentials in libmongocrypt format.

Returns:

  • (BSON::Document)

    Local KMS credentials in libmongocrypt format.



54
55
56
57
58
59
# File 'lib/mongo/crypt/kms/local/credentials.rb', line 54

def to_document
  return BSON::Document.new({}) if empty?
  BSON::Document.new({
    key: BSON::Binary.new(@key, :generic),
  })
end