[New-bugs-announce] [issue19448] SSL: add OID / NID lookup

Christian Heimes report at bugs.python.org
Wed Oct 30 10:55:08 CET 2013


New submission from Christian Heimes:

For #17134 I need a decent way to map OIDs to human readable strings and vice versa. OpenSSL has a couple of method for the task, e.g. http://www.openssl.org/docs/crypto/OBJ_nid2obj.html

The patch implements three ways to lookup NID, SN, LN and OID: by OpenSSL's internal numeric id (NID), by OID or by name:

>>> ssl.txt2obj("MD5", name=True)
ASN1Object(nid=4, shortname='MD5', longname='md5', oid='1.2.840.113549.2.5')
>>> ssl.txt2obj("clientAuth", name=True)
ASN1Object(nid=130, shortname='clientAuth', longname='TLS Web Client Authentication', oid='1.3.6.1.5.5.7.3.2')
>>> ssl.txt2obj("1.3.6.1.5.5.7.3.1")
ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1')

----------
files: ssl_asn1obj.patch
keywords: patch
messages: 201724
nosy: christian.heimes, giampaolo.rodola, janssen, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: SSL: add OID / NID lookup
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file32423/ssl_asn1obj.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19448>
_______________________________________


More information about the New-bugs-announce mailing list