Home | Trees | Indices | Help |
|
---|
|
object --+ | DerObject --+ | DerObjectId
Class to model a DER OBJECT ID.
An example of encoding is:
>>> from Crypto.Util.asn1 import DerObjectId >>> from binascii import hexlify, unhexlify >>> oid_der = DerObjectId("1.2") >>> oid_der.value += ".840.113549.1.1.1" >>> print hexlify(oid_der.encode())
which will show 06092a864886f70d010101, the DER encoding for the RSA Object Identifier 1.2.840.113549.1.1.1.
For decoding:
>>> s = unhexlify(b'06092a864886f70d010101') >>> try: >>> oid_der = DerObjectId() >>> oid_der.decode(s) >>> print oid_der.value >>> except (ValueError, EOFError): >>> print "Not a valid DER OBJECT ID"
the output will be 1.2.840.113549.1.1.1.
Instance Methods | |||
|
|||
|
|||
|
|||
Inherited from |
Instance Variables | |
value The Object ID, a dot separated list of integers |
Properties | |
Inherited from |
Method Details |
|
|
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Apr 15 04:33:26 2019 | http://epydoc.sourceforge.net |