Class: Archive::Zip::Codec::NullEncryption

Inherits:
Object
  • Object
show all
Defined in:
lib/archive/zip/codec/null_encryption.rb

Overview

Archive::Zip::Codec::NullEncryption is a handle for an encryption codec which passes data through itself unchanged.

Defined Under Namespace

Classes: Decrypt, Encrypt

Instance Method Summary collapse

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::NullEncryption::Decrypt object using that class’ open method.



207
208
209
# File 'lib/archive/zip/codec/null_encryption.rb', line 207

def decryptor(io, password, &b)
  Decrypt.open(io, &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::NullEncryption::Encrypt object using that class’ open method.



197
198
199
# File 'lib/archive/zip/codec/null_encryption.rb', line 197

def encryptor(io, password, &b)
  Encrypt.open(io, &b)
end

#general_purpose_flagsObject

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.



225
226
227
# File 'lib/archive/zip/codec/null_encryption.rb', line 225

def general_purpose_flags
  0b0000000000000000
end

#header_sizeObject

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.



233
234
235
# File 'lib/archive/zip/codec/null_encryption.rb', line 233

def header_size
  0
end

#version_needed_to_extractObject

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.



216
217
218
# File 'lib/archive/zip/codec/null_encryption.rb', line 216

def version_needed_to_extract
  0x0014
end