Sha256: 0efdda4905be847884f55f32f3389dd99edd8d734a9feeaefcf1d10b9a998d9e

Contents?: true

Size: 692 Bytes

Versions: 120

Compression:

Stored size: 692 Bytes

Contents

module Aws
  module S3
    module Encryption
      # @api private
      class IODecrypter

        # @param [OpenSSL::Cipher] cipher
        # @param [#write] io An IO-like object that responds to {#write}.
        def initialize(cipher, io)
          @orig_cipher = cipher.clone
          @cipher = cipher.clone
          @io = io
          reset_cipher
        end

        # @return [#write]
        attr_reader :io

        def write(chunk)
          @io.write(@cipher.update(chunk))
        end

        def finalize
          @io.write(@cipher.final)
        end

        private

        def reset_cipher
          @cipher = @orig_cipher.clone
        end

      end
    end
  end
end

Version data entries

120 entries across 120 versions & 1 rubygems

Version Path
aws-sdk-resources-2.1.26 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.25 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.24 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.23 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.22 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.21 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.20 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.19 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.18 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.17 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.16 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.15 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.14 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.13 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.12 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.11 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.10 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.9 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.8 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.1.7 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb