Sha256: dc4a7b5853647c06297ba48ff95d8f3479eb36264e82484f81b8aee596e5491b

Contents?: true

Size: 1.16 KB

Versions: 211

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

module Aws
  module S3
    module Encryption

      # 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.
      # @api private
      class DefaultKeyProvider

        include KeyProvider

        # @option options [required, OpenSSL::PKey::RSA, String] :encryption_key
        #   The master key to use for encrypting objects.
        # @option options [String<JSON>] :materials_description ('{}')
        #   A description of the encryption key.
        def initialize(options = {})
          @encryption_materials = Materials.new(
            key: options[:encryption_key],
            description: options[:materials_description] || '{}'
          )
        end

        # @return [Materials]
        def encryption_materials
          @encryption_materials
        end

        # @param [String<JSON>] materials_description
        # @return Returns the key given in the constructor.
        def key_for(materials_description)
          @encryption_materials.key
        end

      end
    end
  end
end

Version data entries

211 entries across 211 versions & 2 rubygems

Version Path
aws-sdk-s3-1.174.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.173.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.172.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.171.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.170.1 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.170.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.169.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.168.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.167.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.166.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.165.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.164.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.163.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.162.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.161.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.160.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.159.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.158.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.157.0 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-s3-1.156.0 lib/aws-sdk-s3/encryption/default_key_provider.rb