관리-도구
편집 파일: ocsp.cpython-39.pyc
a �a�8 � @ s6 d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dlm Z m Z d dlmZm Z mZmZ G dd� dej�ZG d d � d ej�Ze je je je je jfZdd� ZG d d� dej�ZG dd� de�ZG dd� de jd�ZG dd� de jd�ZG dd� de�Z G dd� de�Z!e"ed�dd�Z#e"ed�dd�Z$dS )� N)�utils)�x509)�ocsp)�hashes� serialization)�PRIVATE_KEY_TYPES�_EARLIEST_UTC_TIME�_convert_to_naive_utc_time�_reject_duplicate_extensionc @ s e Zd ZdZdZdS )�OCSPResponderEncodingzBy HashzBy NameN)�__name__� __module__�__qualname__�HASH�NAME� r r �</usr/lib64/python3.9/site-packages/cryptography/x509/ocsp.pyr s r c @ s$ e Zd ZdZdZdZdZdZdZdS )�OCSPResponseStatusr � � � � � N) r r r � SUCCESSFULZMALFORMED_REQUESTZINTERNAL_ERRORZ TRY_LATERZSIG_REQUIREDZUNAUTHORIZEDr r r r r s r c C s t | t�std��d S )Nz9Algorithm must be SHA1, SHA224, SHA256, SHA384, or SHA512)� isinstance�_ALLOWED_HASHES� ValueError)� algorithmr r r �_verify_algorithm- s �r c @ s e Zd ZdZdZdZdS )�OCSPCertStatusr r r N)r r r ZGOOD�REVOKEDZUNKNOWNr r r r r 4 s r c @ s e Zd Zdd� ZdS )�_SingleResponsec C s t |tj�rt |tj�s td��t|� t |tj�s<td��|d urXt |tj�sXtd��|| _|| _|| _|| _ || _ t |t�s�td��|tjur�|d ur�t d��|d ur�t d��nHt |tj�s�td��t|�}|tk r�t d��|d ur�t |tj�s�td ��|| _|| _|| _d S ) N�%cert and issuer must be a Certificatez%this_update must be a datetime objectz-next_update must be a datetime object or Nonez8cert_status must be an item from the OCSPCertStatus enumzBrevocation_time can only be provided if the certificate is revokedzDrevocation_reason can only be provided if the certificate is revokedz)revocation_time must be a datetime objectz7The revocation_time must be on or after 1950 January 1.zCrevocation_reason must be an item from the ReasonFlags enum or None)r r �Certificate� TypeErrorr �datetimeZ_certZ_issuerZ _algorithmZ_this_updateZ_next_updater r r r r �ReasonFlagsZ_cert_statusZ_revocation_timeZ_revocation_reason) �self�cert�issuerr �cert_status�this_update�next_update�revocation_time�revocation_reasonr r r �__init__; sZ � � � ��� ��z_SingleResponse.__init__N)r r r r/ r r r r r! : s r! c @ s� e Zd Zejed�dd��Zejed�dd��Zejej d�dd��Z ejed�dd ��Zej ejed �dd��Zejejd�d d��ZdS )�OCSPRequest��returnc C s dS �z3 The hash of the issuer public key Nr �r'