rfc4043.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #
  2. # This file is part of pyasn1-modules software.
  3. #
  4. # Created by Russ Housley with 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. # Internet X.509 Public Key Infrastructure Permanent Identifier
  10. #
  11. # ASN.1 source from:
  12. # https://www.rfc-editor.org/rfc/rfc4043.txt
  13. #
  14. from pyasn1.type import char
  15. from pyasn1.type import namedtype
  16. from pyasn1.type import univ
  17. from pyasn1_modules import rfc5280
  18. id_pkix = univ.ObjectIdentifier((1, 3, 6, 1, 5, 5, 7, ))
  19. id_on = id_pkix + (8, )
  20. id_on_permanentIdentifier = id_on + (3, )
  21. class PermanentIdentifier(univ.Sequence):
  22. componentType = namedtype.NamedTypes(
  23. namedtype.OptionalNamedType('identifierValue', char.UTF8String()),
  24. namedtype.OptionalNamedType('assigner', univ.ObjectIdentifier())
  25. )
  26. # Map of Other Name OIDs to Other Name is added to the
  27. # ones that are in rfc5280.py
  28. _anotherNameMapUpdate = {
  29. id_on_permanentIdentifier: PermanentIdentifier(),
  30. }
  31. rfc5280.anotherNameMap.update(_anotherNameMapUpdate)