| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
DerObject --+
|
DerInteger
Class to model a DER INTEGER.
An example of encoding is:
>>> from Crypto.Util.asn1 import DerInteger >>> from binascii import hexlify, unhexlify >>> int_der = DerInteger(9) >>> print hexlify(int_der.encode())
which will show 020109, the DER encoding of 9.
And for decoding:
>>> s = unhexlify(b'020109') >>> try: >>> int_der = DerInteger() >>> int_der.decode(s) >>> print int_der.value >>> except (ValueError, EOFError): >>> print "Not a valid DER INTEGER"
the output will be 9.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
Inherited from |
|||
| Instance Variables | |
|
value The integer value |
|
| Properties | |
|
Inherited from |
| Method Details |
|
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Sep 7 14:45:24 2020 | http://epydoc.sourceforge.net |