print out original stored value

This commit is contained in:
James Bowes 2012-07-26 13:56:45 -03:00
parent afb59bf7fa
commit 4e0f638cd2

View file

@ -49,6 +49,9 @@ def compress_prefix(hash)
return hash return hash
end end
def binary_write(file, hash)
end
if $0 == __FILE__ if $0 == __FILE__
if ARGV.length == 0 if ARGV.length == 0
cert_data = STDIN.read cert_data = STDIN.read
@ -57,7 +60,7 @@ if $0 == __FILE__
content_hex = cert.extensions.detect {|ext| ext.oid == 'subjectKeyIdentifier' } content_hex = cert.extensions.detect {|ext| ext.oid == 'subjectKeyIdentifier' }
abort('ERROR: no X509v3 extension for subjectKeyIdentifier') unless content_hex abort('ERROR: no X509v3 extension for subjectKeyIdentifier') unless content_hex
puts akamai_hex_to_content_set(content_hex.value) puts akamai_hex_to_content_set(content_hex.value).join("|")
end end
ARGV.each do |arg| ARGV.each do |arg|
@ -87,7 +90,8 @@ if $0 == __FILE__
h = mk_hash(chunks, h) h = mk_hash(chunks, h)
end end
h = compress_prefix(h) h = compress_prefix(h)
file.write(h.to_json) binary_write(file, h)
# file.write(h.to_json)
end end
puts "Wrote:\n [%d] %s\n [%d] %s" % [File.size(txt_name), txt_name, File.size(json_name), json_name] puts "Wrote:\n [%d] %s\n [%d] %s" % [File.size(txt_name), txt_name, File.size(json_name), json_name]