codekingpro/portable-devtools
114k
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, LLC7# License: http://snmplabs.com/pyasn1/license.html8#9# Authentication Context Certificate Extension10#11# ASN.1 source from:12# https://www.rfc-editor.org/rfc/rfc7773.txt13#14 15from pyasn1.type import char16from pyasn1.type import constraint17from pyasn1.type import namedtype18from pyasn1.type import univ19 20from pyasn1_modules import rfc528021 22MAX = float('inf')23 24 25# Authentication Context Extension26 27e_legnamnden = univ.ObjectIdentifier('1.2.752.201')28 29id_eleg_ce = e_legnamnden + (5, )30 31id_ce_authContext = id_eleg_ce + (1, )32 33 34class AuthenticationContext(univ.Sequence):35 componentType = namedtype.NamedTypes(36 namedtype.NamedType('contextType', char.UTF8String()),37 namedtype.OptionalNamedType('contextInfo', char.UTF8String())38 )39 40class AuthenticationContexts(univ.SequenceOf):41 componentType = AuthenticationContext()42 subtypeSpec=constraint.ValueSizeConstraint(1, MAX)43 44 45# Map of Certificate Extension OIDs to Extensions added to the46# ones that are in rfc5280.py47 48_certificateExtensionsMapUpdate = {49 id_ce_authContext: AuthenticationContexts(),50}51 52rfc5280.certificateExtensionsMap.update(_certificateExtensionsMapUpdate)53 