diff options
| author | Randy Morgan <[email protected]> | 2012-01-06 23:09:49 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-01-06 23:09:49 +0900 |
| commit | c16ba34f2165712f37470d127039beb8343f8cfe (patch) | |
| tree | fd0c16c5d8f990cd13dc0fbadc0138da44257911 | |
| parent | 564bd125920a2dc86113a1c304f5f094a6045dcb (diff) | |
| download | caxlsx-c16ba34f2165712f37470d127039beb8343f8cfe.tar.gz caxlsx-c16ba34f2165712f37470d127039beb8343f8cfe.zip | |
remove crypto for release
| -rw-r--r-- | lib/axlsx.rb | 6 | ||||
| -rw-r--r-- | lib/axlsx/package.rb | 8 | ||||
| -rw-r--r-- | lib/axlsx/util/cbf.rb | 47 |
3 files changed, 53 insertions, 8 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb index d60a4aa8..76f49fa4 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -6,9 +6,9 @@ require 'axlsx/version.rb' require 'axlsx/util/simple_typed_list.rb' require 'axlsx/util/constants.rb' require 'axlsx/util/validators.rb' -require 'axlsx/util/storage.rb' -require 'axlsx/util/cbf.rb' -require 'axlsx/util/ms_off_crypto.rb' +# require 'axlsx/util/storage.rb' +# require 'axlsx/util/cbf.rb' +# require 'axlsx/util/ms_off_crypto.rb' # to be included with parsable intitites. diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index 8d124ba3..b725c0c7 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -89,10 +89,10 @@ module Axlsx end # Encrypt the package into a CFB using the password provided - def encrypt(file_name, password) - moc = MsOffCrypto.new(file_name, password) - moc.save - end + # def encrypt(file_name, password) + # moc = MsOffCrypto.new(file_name, password) + # moc.save + # end # Validate all parts of the package against xsd schema. # @return [Array] An array of all validation errors found. diff --git a/lib/axlsx/util/cbf.rb b/lib/axlsx/util/cbf.rb index b1725457..1e2371f1 100644 --- a/lib/axlsx/util/cbf.rb +++ b/lib/axlsx/util/cbf.rb @@ -53,6 +53,18 @@ module Axlsx @primary ||= create_primary end + # returns the summary information storage + # @return [Storage] + def summary_information + @summary_information ||= create_summary_information + end + + # returns the document summary information + # @return [Storage] + def document_summary_information + @document_summary_information ||= create_document_summary_information + end + # returns the stream of data allocated in the fat # @return [String] def fat_stream @@ -212,7 +224,40 @@ module Axlsx v_stream = [88,1,76,"{FF9A3F03-56EF-4613-BDD5-5A41C1D07246}".bytes.to_a].flatten v_stream.concat [78, "Microsoft.Container.EncryptionTransform".bytes.to_a,1,1,1,4].flatten v_stream = v_stream.pack PRIMARY_PACKING - Storage.new([6].pack("c")+"Primary", :data=>v_stream, :size=>v_stream.size) + Storage.new([6].pack("c")+"Primary", :data=>v_stream) + end + + + SUMMARY_INFORMATION_PACKING = "" + # creates the summary information storage + # @return [Storage] + def create_summary_information + # FEFF 0000 030A 0100 0000 0000 0000 0000 + # 0000 0000 0000 0000 0100 0000 E085 9FF2 + # F94F 6810 AB91 0800 2B27 B3D9 3000 0000 + # AC00 0000 0700 0000 0100 0000 4000 0000 + # 0400 0000 4800 0000 0800 0000 5800 0000 + # 1200 0000 6800 0000 0C00 0000 8C00 0000 + # 0D00 0000 9800 0000 1300 0000 A400 0000 + # 0200 0000 E9FD 0000 1E00 0000 0800 0000 + # 7261 6E64 796D 0000 1E00 0000 0800 0000 + # 7261 6E64 796D 0000 1E00 0000 1C00 0000 + # 4D69 6372 6F73 6F66 7420 4D61 6369 6E74 + # 6F73 6820 4578 6365 6C00 0000 4000 0000 + # 10AC 5396 60BC CC01 4000 0000 40F4 FDAF + # 60BC CC01 0300 0000 0100 0000 + v_stream = [] + v_stream = v_stream.pack SUMMARY_INFORMATION_PACKING + Storage.new([5].pack('c')+"SummaryInformation", :data=>v_stream) + end + + DOCUMENT_SUMMARY_INFORMATION_PACKING = "" + # creates the document summary information storage + # @return [Storage] + def create_document_summary_information + v_stream = [] + v_stream = v_stream.pack DOCUMENT_SUMMARY_INFORMATION_PACKING + Storage.new([5].pack('c')+"DocumentSummaryInformation", :data=>v_stream) end # Creates the header |
