OLD | NEW |
| (Empty) |
1 # | |
2 # PKCS#1 syntax | |
3 # | |
4 # ASN.1 source from: | |
5 # ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1.asn | |
6 # | |
7 # Sample captures could be obtained with "openssl genrsa" command | |
8 # | |
9 from pyasn1_modules.rfc2437 import * | |
10 | |
11 class OtherPrimeInfo(univ.Sequence): | |
12 componentType = namedtype.NamedTypes( | |
13 namedtype.NamedType('prime', univ.Integer()), | |
14 namedtype.NamedType('exponent', univ.Integer()), | |
15 namedtype.NamedType('coefficient', univ.Integer()) | |
16 ) | |
17 | |
18 class OtherPrimeInfos(univ.SequenceOf): | |
19 componentType = OtherPrimeInfo() | |
20 subtypeSpec = univ.SequenceOf.subtypeSpec + \ | |
21 constraint.ValueSizeConstraint(1, MAX) | |
22 | |
23 class RSAPrivateKey(univ.Sequence): | |
24 componentType = namedtype.NamedTypes( | |
25 namedtype.NamedType('version', univ.Integer(namedValues=namedval.NamedVa
lues(('two-prime', 0), ('multi', 1)))), | |
26 namedtype.NamedType('modulus', univ.Integer()), | |
27 namedtype.NamedType('publicExponent', univ.Integer()), | |
28 namedtype.NamedType('privateExponent', univ.Integer()), | |
29 namedtype.NamedType('prime1', univ.Integer()), | |
30 namedtype.NamedType('prime2', univ.Integer()), | |
31 namedtype.NamedType('exponent1', univ.Integer()), | |
32 namedtype.NamedType('exponent2', univ.Integer()), | |
33 namedtype.NamedType('coefficient', univ.Integer()), | |
34 namedtype.OptionalNamedType('otherPrimeInfos', OtherPrimeInfos()) | |
35 ) | |
OLD | NEW |