MCPcopy Create free account
hub / github.com/secdev/scapy / __call__

Method __call__

scapy/layers/tls/cert.py:1298–1316  ·  view source on GitHub ↗
(cls, cert_path)

Source from the content-addressed store, hash-verified

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
1319class CSR(metaclass=_CSRMaker):

Callers

nothing calls this directly

Calls 4

CMS_ContentInfoClass · 0.90
__call__Method · 0.45
import_from_asn1pktMethod · 0.45

Tested by

no test coverage detected