LINK="#0000bb" VLINK="#551a8b" ALINK="#ff0000">

ASN.1 universal data types

The pysnmp.asn1.univ module implements so-called "universal" ASN.1 types as defined by ASN.1 standard.

The following classes implement simple ASN.1 types:

class Boolean([value])

Instances of this class represent ASN.1 BOOLEAN data type. This is a subclass of base.SimpleAsn1Object class, with additional methods (see below) and the following deviations from the base class:

The default value for Boolean object is 0 (false).

class Integer([value])

Instances of this class represent ASN.1 INTEGER data type. This is a subclass of base.SimpleAsn1Object class, with additional methods (see below) and the following deviations from the base class:

The default value for Integer object is 0L.

class BitString([value])

Instances of this class represent ASN.1 BITSTRING data type. This is a subclass of base.SimpleAsn1Object class, with the following deviations from the base class:

class OctetString([value])

Instances of this class represent ASN.1 OCTETSTRING data type. This is a subclass of base.SimpleAsn1Object class, with additional methods (see below) and the following deviations from the base class:

class Null([value])

Instances of this class represent ASN.1 NULL data type. This is a subclass of base.SimpleAsn1Object class, with the following deviations from the base class:

class ObjectIdentifier([value])

Instances of this class represent ASN.1 OBJECT IDENTIFIER data type. This is a subclass of base.SimpleAsn1Object class, with additional methods (see below) and the following deviations from the base class:

The ObjectIdentifier objects operate with ASN.1 OBJECT IDENTIFIER values given as string (in '1.3.4' like notation) or list of integers ([1, 3, 4]).

The following classes inplement structured ASN.1 types:

class Sequence([**kwargs])

Instances of this class represent ASN.1 SEQUENCE data type. This is a subclass of base.RecordTypeAsn1Object class, with the following deviations from the base class:

class SequenceOf([args])

Instances of this class represent ASN.1 SEQUENCE OF data type. This is a subclass of base.VariableTypeAsn1Object class, with the following deviations from the base class:

class Set([**kwargs])

Instances of this class represent ASN.1 SET data type. This is a subclass of base.RecordTypeAsn1Object class, with the following deviations from the base class:

class SetOf([args])

Instances of this class represent ASN.1 SET OF data type. This is a subclass of base.VariableTypeAsn1Object class, with the following deviations from the base class:

class Choice([**kwargs])

Instances of this class represent ASN.1 CHOICE data type. This is a subclass of base.ChoiceTypeAsn1Object class, with the following deviations from the base class:

Methods of the above classes may raise exceptions based on error.Asn1Error base class.


Subsections


ilya@glas.net