Class: Archive::Zip::Codec::TraditionalEncryption
- Inherits:
-
Object
- Object
- Archive::Zip::Codec::TraditionalEncryption
- Defined in:
- lib/archive/zip/codec/traditional_encryption.rb
Overview
Archive::Zip::Codec::TraditionalEncryption is a handle for the traditional encryption codec.
Defined Under Namespace
Classes: Base, Decrypt, Encrypt
Instance Attribute Summary collapse
-
#mtime ⇒ Object
The last modified time of the entry to be processed.
Instance Method Summary collapse
-
#decryptor(io, password, &b) ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
-
#encryptor(io, password, &b) ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
-
#general_purpose_flags ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
-
#header_size ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
-
#version_needed_to_extract ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
Instance Attribute Details
#mtime ⇒ Object
The last modified time of the entry to be processed. Set this before calling #encryptor or #decryptor.
366 367 368 |
# File 'lib/archive/zip/codec/traditional_encryption.rb', line 366 def mtime @mtime end |
Instance Method Details
#decryptor(io, password, &b) ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
A convenience method for creating an Archive::Zip::Codec::TraditionalEncryption::Decrypt object using that class’ open method.
384 385 386 |
# File 'lib/archive/zip/codec/traditional_encryption.rb', line 384 def decryptor(io, password, &b) Decrypt.open(io, password, mtime, &b) end |
#encryptor(io, password, &b) ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
A convenience method for creating an Archive::Zip::Codec::TraditionalEncryption::Encrypt object using that class’ open method.
374 375 376 |
# File 'lib/archive/zip/codec/traditional_encryption.rb', line 374 def encryptor(io, password, &b) Encrypt.open(io, password, mtime, &b) end |
#general_purpose_flags ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
Returns an integer representing the general purpose flags of a ZIP archive entry using this encryption codec.
402 403 404 |
# File 'lib/archive/zip/codec/traditional_encryption.rb', line 402 def general_purpose_flags 0b0000000000000001 end |
#header_size ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
Returns the size of the encryption header in bytes.
410 411 412 |
# File 'lib/archive/zip/codec/traditional_encryption.rb', line 410 def header_size 12 end |
#version_needed_to_extract ⇒ Object
This method signature is part of the interface contract expected by Archive::Zip::Entry for encryption codec objects.
Returns an integer which indicates the version of the official ZIP specification which introduced support for this encryption codec.
393 394 395 |
# File 'lib/archive/zip/codec/traditional_encryption.rb', line 393 def version_needed_to_extract 0x0014 end |