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

Method sign

src/cryptography/x509/ocsp.py:350–362  ·  view source on GitHub ↗
(
        self,
        private_key: CertificateIssuerPrivateKeyTypes,
        algorithm: hashes.HashAlgorithm | None,
    )

Source from the content-addressed store, hash-verified

348 )
349
350 def sign(
351 self,
352 private_key: CertificateIssuerPrivateKeyTypes,
353 algorithm: hashes.HashAlgorithm | None,
354 ) -> OCSPResponse:
355 if self._response is None:
356 raise ValueError("You must add a response before signing")
357 if self._responder_id is None:
358 raise ValueError("You must add a responder_id before signing")
359
360 return ocsp.create_ocsp_response(
361 OCSPResponseStatus.SUCCESSFUL, self, private_key, algorithm
362 )
363
364 @classmethod
365 def build_unsuccessful(

Calls

no outgoing calls