Class: Aws::S3::Encryption::IODecrypter Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cipher, io) ⇒ IODecrypter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of IODecrypter.

Parameters:

  • cipher (OpenSSL::Cipher)
  • io (IO#write)

    An IO-like object that responds to ‘#write`.



9
10
11
12
# File 'lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb', line 9

def initialize(cipher, io)
  @cipher = cipher.clone
  @io = io
end

Instance Attribute Details

#io#write (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



15
16
17
# File 'lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb', line 15

def io
  @io
end

Instance Method Details

#finalizeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
# File 'lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb', line 22

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

#write(chunk) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



17
18
19
20
# File 'lib/aws-sdk-resources/services/s3/encryption/io_decrypter.rb', line 17

def write(chunk)
  # decrypt and write
  @io.write(@cipher.update(chunk))
end