diff --git a/pyimg4/_parser.py b/pyimg4/_parser.py index c6c73c9..4d2104d 100644 --- a/pyimg4/_parser.py +++ b/pyimg4/_parser.py @@ -1074,7 +1074,7 @@ def __repr__(self) -> str: def _parse(self) -> None: self._decoder.start(self._data) - if self._decoder.read()[0].nr != asn1.Numbers.Integer: + if self._decoder.peek().nr != asn1.Numbers.Integer: raise UnexpectedTagError(self._decoder.peek(), asn1.Numbers.Integer) self.type = KeybagType(self._decoder.read()[1])