rfc7296.py 885 B

1234567891011121314151617181920212223242526272829303132
  1. # This file is being contributed to pyasn1-modules software.
  2. #
  3. # Created by Russ Housley.
  4. #
  5. # Copyright (c) 2019, Vigil Security, LLC
  6. # License: http://snmplabs.com/pyasn1/license.html
  7. #
  8. # IKEv2 Certificate Bundle
  9. #
  10. # ASN.1 source from:
  11. # https://www.rfc-editor.org/rfc/rfc7296.txt
  12. from pyasn1.type import namedtype
  13. from pyasn1.type import tag
  14. from pyasn1.type import univ
  15. from pyasn1_modules import rfc5280
  16. class CertificateOrCRL(univ.Choice):
  17. pass
  18. CertificateOrCRL.componentType = namedtype.NamedTypes(
  19. namedtype.NamedType('cert', rfc5280.Certificate().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
  20. namedtype.NamedType('crl', rfc5280.CertificateList().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
  21. )
  22. class CertificateBundle(univ.SequenceOf):
  23. pass
  24. CertificateBundle.componentType = CertificateOrCRL()