OLD | NEW |
(Empty) | |
| 1 # |
| 2 # PKCS#10 syntax |
| 3 # |
| 4 # ASN.1 source from: |
| 5 # http://tools.ietf.org/html/rfc2314 |
| 6 # |
| 7 # Sample captures could be obtained with "openssl req" command |
| 8 # |
| 9 from pyasn1.type import tag, namedtype, namedval, univ, constraint |
| 10 from pyasn1_modules.rfc2459 import * |
| 11 |
| 12 class Attributes(univ.SetOf): |
| 13 componentType = Attribute() |
| 14 |
| 15 class Version(univ.Integer): pass |
| 16 |
| 17 class CertificationRequestInfo(univ.Sequence): |
| 18 componentType = namedtype.NamedTypes( |
| 19 namedtype.NamedType('version', Version()), |
| 20 namedtype.NamedType('subject', Name()), |
| 21 namedtype.NamedType('subjectPublicKeyInfo', SubjectPublicKeyInfo()), |
| 22 namedtype.NamedType('attributes', Attributes().subtype(implicitTag=tag.T
ag(tag.tagClassContext, tag.tagFormatConstructed, 0))) |
| 23 ) |
| 24 |
| 25 class Signature(univ.BitString): pass |
| 26 class SignatureAlgorithmIdentifier(AlgorithmIdentifier): pass |
| 27 |
| 28 class CertificationRequest(univ.Sequence): |
| 29 componentType = namedtype.NamedTypes( |
| 30 namedtype.NamedType('certificationRequestInfo', CertificationRequestInfo
()), |
| 31 namedtype.NamedType('signatureAlgorithm', SignatureAlgorithmIdentifier()
), |
| 32 namedtype.NamedType('signature', Signature()) |
| 33 ) |
OLD | NEW |