(cls, cert_path)
| 1296 | """ |
| 1297 | |
| 1298 | def __call__(cls, cert_path): |
| 1299 | obj = _PKIObjMaker.__call__(cls, cert_path, _MAX_CSR_SIZE) |
| 1300 | obj.__class__ = CSR |
| 1301 | try: |
| 1302 | # PKCS#10 format |
| 1303 | csr = PKCS10_CertificationRequest(obj._der) |
| 1304 | obj.marker = "NEW CERTIFICATE REQUEST" |
| 1305 | obj.fmt = CSR.FORMAT.PKCS10 |
| 1306 | except Exception: |
| 1307 | try: |
| 1308 | # CMC format |
| 1309 | csr = CMS_ContentInfo(obj._der) |
| 1310 | obj.marker = "NEW CERTIFICATE REQUEST" |
| 1311 | obj.fmt = CSR.FORMAT.CMC |
| 1312 | except Exception: |
| 1313 | raise Exception("Unable to import CSR") |
| 1314 | |
| 1315 | obj.import_from_asn1pkt(csr) |
| 1316 | return obj |
| 1317 | |
| 1318 | |
| 1319 | class CSR(metaclass=_CSRMaker): |
nothing calls this directly
no test coverage detected