1# 2# This file is part of pyasn1-modules software. 3# 4# Created by Russ Housley with some assistance from asn1ate v.0.6.0. 5# 6# Copyright (c) 2019, Vigil Security, LLC 7# License: http://snmplabs.com/pyasn1/license.html 8# 9# Network Access Identifier (NAI) Realm Name for Certificates 10# 11# ASN.1 source from: 12# https://www.rfc-editor.org/rfc/rfc7585.txt 13# 14 15from pyasn1.type import char 16from pyasn1.type import constraint 17from pyasn1.type import univ 18 19from pyasn1_modules import rfc5280 20 21 22# NAI Realm Name for Certificates 23 24id_pkix = univ.ObjectIdentifier('1.3.6.1.5.5.7') 25 26id_on = id_pkix + (8, ) 27 28id_on_naiRealm = id_on + (8, ) 29 30 31ub_naiRealm_length = univ.Integer(255) 32 33 34class NAIRealm(char.UTF8String): 35 subtypeSpec = constraint.ValueSizeConstraint(1, ub_naiRealm_length) 36 37 38naiRealm = rfc5280.AnotherName() 39naiRealm['type-id'] = id_on_naiRealm 40naiRealm['value'] = NAIRealm() 41 42 43# Map of Other Name OIDs to Other Name is added to the 44# ones that are in rfc5280.py 45 46_anotherNameMapUpdate = { 47 id_on_naiRealm: NAIRealm(), 48} 49 50rfc5280.anotherNameMap.update(_anotherNameMapUpdate) 51