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.3.12 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.11 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.10 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.9 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.8 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.7 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.6 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.5 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.4 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.3 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.2 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.1 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.3.0 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.2.37 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.2.36 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.2.35 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.2.34 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.2.33 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.2.32 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb
aws-sdk-resources-2.2.31 lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb