I've got an extension which is described as follows:
Extension().setComponentByPosition(0, ObjectIdentifier(2.5.29.19))
.setComponentByPosition(1, Boolean('False'))
.setComponentByPosition(2, Any(hexValue='04023000'))
So based on the id, it's a BasicConstraints
extension. However if I try to parse the value as the extension itself, I get an error:
decoder.decode(decoder.decode(e['extnValue'])[0], rfc2459.BasicConstraints())
# PyAsn1Error: Uninitialized component #0 at BasicConstraints()
That string decodes to an empty sequence, so it can legally be a BasicConstraints
- name length
optional/missing and ca
is default, so not encoded in DER.
So what am I missing here? How do I decode this extension to the BasicConstraints
class?
PS. this issue seems similar to an issue in mailing list, but I'm using 0.1.8 which should already include the mentioned fix