Class: Aws::S3::Encryption::DefaultKeyProvider Private

Inherits:
Object
  • Object
show all
Includes:
KeyProvider
Defined in:
lib/aws-sdk-s3/encryption/default_key_provider.rb

Overview

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

The default key provider is constructed with a single key that is used for both encryption and decryption, ignoring the possible per-object envelope encryption materials description.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ DefaultKeyProvider

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 a new instance of DefaultKeyProvider.

Parameters:

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

    a customizable set of options

Options Hash (options):

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

    The master key to use for encrypting objects.

  • :materials_description (String<JSON>) — default: '{}'

    A description of the encryption key.



17
18
19
20
21
22
# File 'lib/aws-sdk-s3/encryption/default_key_provider.rb', line 17

def initialize(options = {})
  @encryption_materials = Materials.new(
    key: options[:encryption_key],
    description: options[:materials_description] || '{}'
  )
end

Instance Method Details

#encryption_materialsMaterials

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:



25
26
27
# File 'lib/aws-sdk-s3/encryption/default_key_provider.rb', line 25

def encryption_materials
  @encryption_materials
end

#key_for(materials_description) ⇒ Object

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 the key given in the constructor.

Parameters:

  • materials_description (String<JSON>)

Returns:

  • Returns the key given in the constructor.



31
32
33
# File 'lib/aws-sdk-s3/encryption/default_key_provider.rb', line 31

def key_for(materials_description)
  @encryption_materials.key
end