class Aws::S3::Encryption::IODecrypter

@api private

Attributes

io[R]

@return [#write]

Public Class Methods

new(cipher, io) click to toggle source

@param [OpenSSL::Cipher] cipher @param [#write] io An IO-like object that responds to {#write}.

# File lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb, line 9
def initialize(cipher, io)
  @orig_cipher = cipher.clone
  @cipher = cipher.clone
  @io = io
  reset_cipher
end

Public Instance Methods

finalize() click to toggle source
# File lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb, line 23
def finalize
  @io.write(@cipher.final)
end
write(chunk) click to toggle source
# File lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb, line 19
def write(chunk)
  @io.write(@cipher.update(chunk))
end

Private Instance Methods

reset_cipher() click to toggle source
# File lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb, line 29
def reset_cipher
  @cipher = @orig_cipher.clone
end