rfc2314.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #
  2. # This file is part of pyasn1-modules software.
  3. #
  4. # Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com>
  5. # License: http://snmplabs.com/pyasn1/license.html
  6. #
  7. # PKCS#10 syntax
  8. #
  9. # ASN.1 source from:
  10. # http://tools.ietf.org/html/rfc2314
  11. #
  12. # Sample captures could be obtained with "openssl req" command
  13. #
  14. from pyasn1_modules.rfc2459 import *
  15. class Attributes(univ.SetOf):
  16. componentType = Attribute()
  17. class Version(univ.Integer):
  18. pass
  19. class CertificationRequestInfo(univ.Sequence):
  20. componentType = namedtype.NamedTypes(
  21. namedtype.NamedType('version', Version()),
  22. namedtype.NamedType('subject', Name()),
  23. namedtype.NamedType('subjectPublicKeyInfo', SubjectPublicKeyInfo()),
  24. namedtype.NamedType('attributes',
  25. Attributes().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
  26. )
  27. class Signature(univ.BitString):
  28. pass
  29. class SignatureAlgorithmIdentifier(AlgorithmIdentifier):
  30. pass
  31. class CertificationRequest(univ.Sequence):
  32. componentType = namedtype.NamedTypes(
  33. namedtype.NamedType('certificationRequestInfo', CertificationRequestInfo()),
  34. namedtype.NamedType('signatureAlgorithm', SignatureAlgorithmIdentifier()),
  35. namedtype.NamedType('signature', Signature())
  36. )