• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# This file is part of pyasn1-modules software.
3#
4# Copyright (c) 2005-2019, 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#
14from pyasn1_modules.rfc2459 import *
15
16
17class Attributes(univ.SetOf):
18    componentType = Attribute()
19
20
21class Version(univ.Integer):
22    pass
23
24
25class CertificationRequestInfo(univ.Sequence):
26    componentType = namedtype.NamedTypes(
27        namedtype.NamedType('version', Version()),
28        namedtype.NamedType('subject', Name()),
29        namedtype.NamedType('subjectPublicKeyInfo', SubjectPublicKeyInfo()),
30        namedtype.NamedType('attributes',
31                            Attributes().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
32    )
33
34
35class Signature(univ.BitString):
36    pass
37
38
39class SignatureAlgorithmIdentifier(AlgorithmIdentifier):
40    pass
41
42
43class CertificationRequest(univ.Sequence):
44    componentType = namedtype.NamedTypes(
45        namedtype.NamedType('certificationRequestInfo', CertificationRequestInfo()),
46        namedtype.NamedType('signatureAlgorithm', SignatureAlgorithmIdentifier()),
47        namedtype.NamedType('signature', Signature())
48    )
49