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.



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

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:



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

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.



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

def key_for(materials_description)
  @encryption_materials.key
end