pyasn1无法单独(不定义新类型)解析下面代码片段中描述的不定长度构造数据是一个错误,还是我的示例不是有效的 BER 编码 ASN.1?
如果 pyasn1 在没有帮助的情况下无法处理这个问题,我可以求助于另一个 python 库吗?
# e7 80 : private, constructed, tag 7, indefinite length
# 02 01 44 : integer 0x44
# 02 01 55 : integer 0x55
# 00 00 : end of contents (terminating the 0xe7 object)
data = 'e7 80 02 01 44 02 01 55 00 00'
data = binascii.unhexlify( ''.join(data.split()) )
# throws pyasn1.error.PyAsn1Error: Missing end-of-octets terminator
pyasn1.codec.ber.decoder.decode(data)