| 1030 | # this lazy implementation actually supports RSA encoding only. |
| 1031 | # We'd rather call it RSAPrivateKey_OpenSSL than X509_PrivateKeyInfo. |
| 1032 | class RSAPrivateKey_OpenSSL(ASN1_Packet): |
| 1033 | ASN1_codec = ASN1_Codecs.BER |
| 1034 | ASN1_root = ASN1F_SEQUENCE( |
| 1035 | ASN1F_enum_INTEGER("version", 0, ["v1", "v2"]), |
| 1036 | ASN1F_PACKET("privateKeyAlgorithm", |
| 1037 | X509_AlgorithmIdentifier(), |
| 1038 | X509_AlgorithmIdentifier), |
| 1039 | ASN1F_PACKET("privateKey", |
| 1040 | RSAPrivateKey(), |
| 1041 | RSAPrivateKey, |
| 1042 | explicit_tag=0x04), |
| 1043 | ASN1F_optional( |
| 1044 | ASN1F_PACKET("parameters", None, ECParameters, |
| 1045 | explicit_tag=0xa0)), |
| 1046 | ASN1F_optional( |
| 1047 | ASN1F_PACKET("publicKey", None, |
| 1048 | ECDSAPublicKey, |
| 1049 | explicit_tag=0xa1))) |
| 1050 | |
| 1051 | # We need this hack because ECParameters parsing below must return |
| 1052 | # a Padding payload, and making the ASN1_Packet class have Padding |
no test coverage detected
searching dependent graphs…