def __init__(self, issuer_cert: str, responder_cert: str, responder_key: str,
validate_func: ValidateFunc, cert_retrieve_func: CertRetrieveFunc,
next_update_days: int = 7):
"""
Create a new OCSPResponder instance.
:param issuer_cert: Path to the issuer certificate.
:param responder_cert: Path to the certificate of the OCSP responder
with the `OCSP Signing` extension.
:param responder_key: Path to the private key belonging to the
responder cert.
:param validate_func: A function that - given a certificate serial -
will return the appropriate :class:`CertificateStatus` and -
depending on the status - a revocation datetime.
:param cert_retrieve_func: A function that - given a certificate serial -
will return the corresponding certificate as a string.
:param next_update_days: The ``nextUpdate`` value that will be written
into the response. Default: 7 days.
"""
# Certs and keys
self._issuer_cert = asymmetric.load_certificate(issuer_cert)
self._responder_cert = asymmetric.load_certificate(responder_cert)
self._responder_key = asymmetric.load_private_key(responder_key)
# Functions
self._validate = validate_func
self._cert_retrieve = cert_retrieve_func
# Next update
self._next_update_days = next_update_days
# Bottle
self._app = Bottle()
# Initialize routing
self._route()
评论列表
文章目录