traverse

OpenSSL::ASN1.traverse(asn1) รข nil
Class Public methods

If a block is given, it prints out each of the elements encountered. Block parameters are (in that order):

  • depth: The recursion depth, plus one with each constructed value being encountered (Number)

  • offset: Current byte offset (Number)

  • header length: Combined length in bytes of the Tag and Length headers. (Number)

  • length: The overall remaining length of the entire data (Number)

  • constructed: Whether this value is constructed or not (Boolean)

  • tag_class: Current tag class (Symbol)

  • tag: The current tag (Number)

Example

der = File.binread('asn1data.der')
OpenSSL::ASN1.traverse(der) do | depth, offset, header_len, length, constructed, tag_class, tag|
  puts "Depth: #{depth} Offset: #{offset} Length: #{length}"
  puts "Header length: #{header_len} Tag: #{tag} Tag class: #{tag_class} Constructed: #{constructed}"
end
doc_ruby_on_rails
2015-04-24 18:02:06
Comments
Leave a Comment

Please login to continue.