Sha256: b3d2e940d170f67c4cfd2570ac59ddd97ab057ebd578609d1c107d54eef0ee0e

Contents?: true

Size: 1.13 KB

Versions: 1027

Compression:

Stored size: 1.13 KB

Contents

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

1,027 entries across 1,027 versions & 3 rubygems

Version Path
aws-sdk-resources-2.11.490 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.489 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.488 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.487 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.486 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.485 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.484 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-s3-1.61.2 lib/aws-sdk-s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.483 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.482 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.481 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.480 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.479 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.478 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.477 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.476 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.475 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.474 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.473 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb
aws-sdk-resources-2.11.472 lib/aws-sdk-resources/services/s3/encryption/default_key_provider.rb