Method: Aws::S3::Encryption::Client#initialize

Defined in:
lib/aws-sdk-resources/services/s3/encryption/client.rb

#initialize(options = {}) ⇒ Client

Creates a new encryption client. You must provide on of the following options:

  • ‘:encryption_key`

  • ‘:kms_key_id`

  • ‘:key_provider`

You may also pass any other options accepted by S3::Client#initialize.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :client (S3::Client)

    A basic S3 client that is used to make api calls. If a ‘:client` is not provided, a new S3::Client will be constructed.

  • :encryption_key (OpenSSL::PKey::RSA, String)

    The master key to use for encrypting/decrypting all objects.

  • :kms_key_id (String)

    When you provide a ‘:kms_key_id`, then AWS Key Management Service (KMS) will be used to manage the object encryption keys. By default a KMS::Client will be constructed for KMS API calls. Alternatively, you can provide your own via `:kms_client`.

  • :key_provider (#key_for)

    Any object that responds to ‘#key_for`. This method should accept a materials description JSON document string and return return an encryption key.

  • :envelope_location (Symbol) — default: :metadata

    Where to store the envelope encryption keys. By default, the envelope is stored with the encrypted object. If you pass ‘:instruction_file`, then the envelope is stored in a separate object in Amazon S3.

  • :instruction_file_suffix (String) — default: '.instruction'

    When ‘:envelope_location` is `:instruction_file` then the instruction file uses the object key with this suffix appended.

  • :kms_client (KMS::Client)

    A default KMS::Client is constructed when using KMS to manage encryption keys.



220
221
222
223
224
225
# File 'lib/aws-sdk-resources/services/s3/encryption/client.rb', line 220

def initialize(options = {})
  @client = extract_client(options)
  @cipher_provider = cipher_provider(options)
  @envelope_location = extract_location(options)
  @instruction_file_suffix = extract_suffix(options)
end