lib/rasn1.rb in rasn1-0.7.1 vs lib/rasn1.rb in rasn1-0.8.0
- old
+ new
@@ -42,10 +42,10 @@
# @param [Boolean] ber if +true+, decode a BER string, else a DER one
# @return [Types::Base]
def self.parse(der, ber: false)
root = nil
until der.empty?
- type = Types.tag2type(der[0].ord)
+ type = Types.id2type(der)
type.parse!(der, ber: ber)
root = type if root.nil?
if [Types::Sequence, Types::Set].include? type.class
subder = type.value