MCPcopy
hub / github.com/pyca/cryptography / add_response

Method add_response

src/cryptography/x509/ocsp.py:216–250  ·  view source on GitHub ↗
(
        self,
        cert: x509.Certificate,
        issuer: x509.Certificate,
        algorithm: hashes.HashAlgorithm,
        cert_status: OCSPCertStatus,
        this_update: datetime.datetime,
        next_update: datetime.datetime | None,
        revocation_time: datetime.datetime | None,
        revocation_reason: x509.ReasonFlags | None,
    )

Source from the content-addressed store, hash-verified

214 self._extensions = extensions
215
216 def add_response(
217 self,
218 cert: x509.Certificate,
219 issuer: x509.Certificate,
220 algorithm: hashes.HashAlgorithm,
221 cert_status: OCSPCertStatus,
222 this_update: datetime.datetime,
223 next_update: datetime.datetime | None,
224 revocation_time: datetime.datetime | None,
225 revocation_reason: x509.ReasonFlags | None,
226 ) -> OCSPResponseBuilder:
227 if self._response is not None:
228 raise ValueError("Only one response per OCSPResponse.")
229
230 if not isinstance(cert, x509.Certificate) or not isinstance(
231 issuer, x509.Certificate
232 ):
233 raise TypeError("cert and issuer must be a Certificate")
234
235 singleresp = _SingleResponse(
236 (cert, issuer),
237 None,
238 algorithm,
239 cert_status,
240 this_update,
241 next_update,
242 revocation_time,
243 revocation_reason,
244 )
245 return OCSPResponseBuilder(
246 singleresp,
247 self._responder_id,
248 self._certs,
249 self._extensions,
250 )
251
252 def add_response_by_hash(
253 self,

Calls 2

_SingleResponseClass · 0.85
OCSPResponseBuilderClass · 0.85