lib/cose/key.rb in cose-0.4.0 vs lib/cose/key.rb in cose-0.4.1

- old
+ new

@@ -5,23 +5,21 @@ module COSE class UnknownKeyType < StandardError; end module Key - LABEL_KTY = 1 - def self.deserialize(data) map = CBOR.decode(data) - case map[LABEL_KTY] + case map[Base::LABEL_KTY] when COSE::Key::EC2::KTY_EC2 COSE::Key::EC2.from_map(map) when COSE::Key::RSA::KTY_RSA COSE::Key::RSA.from_map(map) when COSE::Key::Symmetric::KTY_SYMMETRIC COSE::Key::Symmetric.from_map(map) else - raise UnknownKeyType, "Unsupported or unknown key type #{map[LABEL_KTY]}" + raise UnknownKeyType, "Unsupported or unknown key type #{map[Base::LABEL_KTY]}" end end end end