Beispiel #1
0
 def __init__(self, name, default, *args, **kwargs):
     if "implicit_tag" in kwargs:
         err_msg = "ASN1F_CHOICE has been called with an implicit_tag"
         raise ASN1_Error(err_msg)
     self.implicit_tag = None
     for kwarg in ["context", "explicit_tag"]:
         if kwarg in kwargs:
             setattr(self, kwarg, kwargs[kwarg])
         else:
             setattr(self, kwarg, None)
     ASN1F_field.__init__(self, name, None, context=self.context,
                          explicit_tag=self.explicit_tag)
     self.default = default
     self.current_choice = None
     self.choices = args
Beispiel #2
0
 def __init__(self, name, default, *args, **kwargs):
     if "implicit_tag" in kwargs:
         err_msg = "ASN1F_CHOICE has been called with an implicit_tag"
         raise ASN1_Error(err_msg)
     self.implicit_tag = None
     for kwarg in ["context", "explicit_tag"]:
         if kwarg in kwargs:
             setattr(self, kwarg, kwargs[kwarg])
         else:
             setattr(self, kwarg, None)
     ASN1F_field.__init__(self, name, None, context=self.context,
                          explicit_tag=self.explicit_tag)
     self.default = default
     self.current_choice = None
     self.choices = args
Beispiel #3
0
class X509_ExtDefault(ASN1_Packet):
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_field("value", None)
Beispiel #4
0
class X509_ExtQcStatement(ASN1_Packet):
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_SEQUENCE(
        ASN1F_OID("statementId", "0.4.0.1862.1.1"),
        ASN1F_optional(ASN1F_field("statementInfo", None)))
Beispiel #5
0
class X509_X400Address(ASN1_Packet):
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_field("x400Address", "")
Beispiel #6
0
class SNMPvarbind(ASN1_Packet):
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_SEQUENCE(ASN1F_OID("oid", "1.3"),
                               ASN1F_field("value", ASN1_NULL(0)))