%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/asn1crypto/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/asn1crypto/__pycache__/ocsp.cpython-37.pyc

B

"�2VRF�@s�dZddlmZmZmZmZddlmZmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZddlmZmZddlmZddlmZmZmZm Z Gd	d
�d
e�Z!Gdd�de�Z"Gd
d�de�Z#Gdd�de�Z$Gdd�de�Z%Gdd�de�Z&Gdd�de�Z'Gdd�de�Z(Gdd�de�Z)Gdd�de�Z*Gdd�de�Z+Gdd �d e�Z,Gd!d"�d"e�Z-Gd#d$�d$e�Z.Gd%d&�d&e�Z/Gd'd(�d(e�Z0Gd)d*�d*e�Z1Gd+d,�d,e�Z2Gd-d.�d.e�Z3Gd/d0�d0e�Z4Gd1d2�d2e�Z5Gd3d4�d4e�Z6Gd5d6�d6e�Z7Gd7d8�d8e�Z8Gd9d:�d:e�Z9Gd;d<�d<e�Z:Gd=d>�d>e�Z;Gd?d@�d@e�Z<GdAdB�dBe�Z=GdCdD�dDe�Z>GdEdF�dFe�Z?GdGdH�dHe�Z@GdIdJ�dJe�ZAGdKdL�dLe�ZBGdMdN�dNe�ZCGdOdP�dPe�ZDdQS)Rz�
ASN.1 type classes for the online certificate status protocol (OCSP). Exports
the following items:

 - OCSPRequest()
 - OCSPResponse()

Other type classes are defined that help compose the types listed above.
�)�unicode_literals�division�absolute_import�print_function�)�DigestAlgorithm�SignedDigestAlgorithm)
�Boolean�Choice�
Enumerated�GeneralizedTime�	IA5String�Integer�Null�ObjectIdentifier�OctetBitString�OctetString�ParsableOctetString�Sequence�
SequenceOf)�AuthorityInfoAccessSyntax�	CRLReason)�PublicKeyAlgorithm)�Certificate�GeneralName�GeneralNames�Namec@seZdZddiZdS)�Versionr�v1N)�__name__�
__module__�__qualname__�_map�r#r#�@/opt/alt/python37/lib/python3.7/site-packages/asn1crypto/ocsp.pyr'src@s(eZdZdefdefdefdefgZdS)�CertIdZhash_algorithmZissuer_name_hashZissuer_key_hashZ
serial_numberN)rr r!rrr�_fieldsr#r#r#r$r%-sr%c@seZdZdefdefgZdS)�ServiceLocatorZissuerZlocatorN)rr r!rrr&r#r#r#r$r'6sr'c@seZdZddiZdS)�RequestExtensionIdz1.3.6.1.5.5.7.48.1.7�service_locatorN)rr r!r"r#r#r#r$r(=sr(c@s4eZdZdefdeddifdefgZdZdeiZ	dS)	�RequestExtension�extn_id�critical�defaultF�
extn_value)r+r.r)N)
rr r!r(r	rr&�	_oid_pairr'�
_oid_specsr#r#r#r$r*Cs

r*c@seZdZeZdS)�RequestExtensionsN)rr r!r*�_child_specr#r#r#r$r1Psr1c@sReZdZdefdedddd�fgZdZdZdZd	d
�Z	e
dd��Ze
d
d��ZdS)�RequestZreq_cert�single_request_extensions�explicitrT)�tag_type�tag�optionalFNcCsht�|_xT|dD]H}|dj}d|}t||�rDt|||dj�|djr|j�|�qWd|_dS)zv
        Sets common named extensions to private attributes and creates a list
        of critical extensions
        r4r+z	_%s_valuer.r,TN)�set�_critical_extensions�native�hasattr�setattr�parsed�add�_processed_extensions)�self�	extension�name�attribute_namer#r#r$�_set_extensions^s


zRequest._set_extensionscCs|js|��|jS)z�
        Returns a set of the names (or OID if not a known extension) of the
        extensions marked as critical

        :return:
            A set of unicode strings
        )r@rEr:)rAr#r#r$�critical_extensionsps
zRequest.critical_extensionscCs|jdkr|��|jS)z�
        This extension is used when communicating with an OCSP responder that
        acts as a proxy for OCSP requests

        :return:
            None or a ServiceLocator object
        F)r@rE�_service_locator_value)rAr#r#r$�service_locator_value~s

zRequest.service_locator_value)
rr r!r%r1r&r@r:rGrE�propertyrFrHr#r#r#r$r3Tsr3c@seZdZeZdS)�RequestsN)rr r!r3r2r#r#r#r$rJ�srJc@seZdZddiZdS)�ResponseTypez1.3.6.1.5.5.7.48.1.1�basic_ocsp_responseN)rr r!r"r#r#r#r$rK�srKc@seZdZeZdS)�AcceptableResponsesN)rr r!rKr2r#r#r#r$rM�srMc@s"eZdZdefdeddifgZdS)�PreferredSignatureAlgorithmZsig_identifierZcert_identifierr8TN)rr r!rrr&r#r#r#r$rN�srNc@seZdZeZdS)�PreferredSignatureAlgorithmsN)rr r!rNr2r#r#r#r$rO�srOc@seZdZdddd�ZdS)�TBSRequestExtensionId�nonce�acceptable_responses�preferred_signature_algorithms)z1.3.6.1.5.5.7.48.1.2z1.3.6.1.5.5.7.48.1.4z1.3.6.1.5.5.7.48.1.8N)rr r!r"r#r#r#r$rP�srPc@s8eZdZdefdeddifdefgZdZee	e
d�ZdS)	�TBSRequestExtensionr+r,r-Fr.)r+r.)rQrRrSN)rr r!rPr	rr&r/rrMrOr0r#r#r#r$rT�s
rTc@seZdZeZdS)�TBSRequestExtensionsN)rr r!rTr2r#r#r#r$rU�srUc	@sFeZdZdedddd�fdedddd	�fd
efdedddd	�fgZd
S)�
TBSRequest�versionr5rr)r6r7r-Zrequestor_namerT)r6r7r8Zrequest_list�request_extensions�N)rr r!rrrJrUr&r#r#r#r$rV�srVc@seZdZeZdS)�CertificatesN)rr r!rr2r#r#r#r$rZ�srZc@s,eZdZdefdefdedddd�fgZdS)	�	Signature�signature_algorithm�	signature�certsr5rT)r6r7r8N)rr r!rrrZr&r#r#r#r$r[�sr[c@sreZdZdefdedddd�fgZdZdZdZdZ	dZ
d	d
�Zedd��Z
ed
d��Zedd��Zedd��ZdS)�OCSPRequest�tbs_requestZoptional_signaturer5rT)r6r7r8FNcCslt�|_xX|ddD]H}|dj}d|}t||�rHt|||dj�|djr|j�|�qWd|_dS)	zv
        Sets common named extensions to private attributes and creates a list
        of critical extensions
        r`rXr+z	_%s_valuer.r,TN)r9r:r;r<r=r>r?r@)rArBrCrDr#r#r$rE�s


zOCSPRequest._set_extensionscCs|js|��|jS)z�
        Returns a set of the names (or OID if not a known extension) of the
        extensions marked as critical

        :return:
            A set of unicode strings
        )r@rEr:)rAr#r#r$rF�s
zOCSPRequest.critical_extensionscCs|jdkr|��|jS)z�
        This extension is used to prevent replay attacks by including a unique,
        random value with each request/response pair

        :return:
            None or an OctetString object
        F)r@rE�_nonce_value)rAr#r#r$�nonce_values

zOCSPRequest.nonce_valuecCs|jdkr|��|jS)a(
        This extension is used to allow the client and server to communicate
        with alternative response formats other than just basic_ocsp_response,
        although no other formats are defined in the standard.

        :return:
            None or an AcceptableResponses object
        F)r@rE�_acceptable_responses_value)rAr#r#r$�acceptable_responses_values
z&OCSPRequest.acceptable_responses_valuecCs|jdkr|��|jS)aj
        This extension is used by the client to define what signature algorithms
        are preferred, including both the hash algorithm and the public key
        algorithm, with a level of detail down to even the public key algorithm
        parameters, such as curve name.

        :return:
            None or a PreferredSignatureAlgorithms object
        F)r@rE�%_preferred_signature_algorithms_value)rAr#r#r$�$preferred_signature_algorithms_values
z0OCSPRequest.preferred_signature_algorithms_value)rr r!rVr[r&r@r:rarcrerErIrFrbrdrfr#r#r#r$r_�sr_c@seZdZddddddd�ZdS)	�OCSPResponseStatusZ
successfulZmalformed_requestZinternal_errorZ	try_laterZ
sign_requiredZunauthorized)rrrY���N)rr r!r"r#r#r#r$rg0srgc@s,eZdZdeddd�fdeddd�fgZdS)�ResponderIdZby_namer5r)r6r7Zby_keyrYN)rr r!rr�
_alternativesr#r#r#r$rk;srkc@s&eZdZdefdedddd�fgZdS)�RevokedInfoZrevocation_timeZrevocation_reasonr5rT)r6r7r8N)rr r!rrr&r#r#r#r$rmBsrmc@s:eZdZdeddd�fdeddd�fdeddd�fgZd	S)
�
CertStatusZgoodZimplicitr)r6r7Zrevokedr�unknownrYN)rr r!rrmrlr#r#r#r$rnIsrnc@s@eZdZdedddd�fdedddd�fdedd	dd�fgZd
S)�CrlIdZcrl_urlr5rT)r6r7r8Zcrl_numrZcrl_timerYN)rr r!r
rrr&r#r#r#r$rpQsrpc@seZdZdddddd�ZdS)�SingleResponseExtensionId�crl�archive_cutoff�
crl_reason�invalidity_date�certificate_issuer)z1.3.6.1.5.5.7.48.1.3z1.3.6.1.5.5.7.48.1.6z	2.5.29.21z	2.5.29.24z	2.5.29.29N)rr r!r"r#r#r#r$rqYs
rqc@s<eZdZdefdeddifdefgZdZee	e
e	ed�ZdS)	�SingleResponseExtensionr+r,r-Fr.)r+r.)rrrsrtrurvN)
rr r!rqr	rr&r/rprrrr0r#r#r#r$rwes
rwc@seZdZeZdS)�SingleResponseExtensionsN)rr r!rwr2r#r#r#r$rxvsrxc
@s�eZdZdefdefdefdedddd�fd	edd
dd�fgZdZdZ	dZ
dZdZdZ
dZd
d�Zedd��Zedd��Zedd��Zedd��Zedd��Zedd��ZdS)�SingleResponseZcert_idZcert_statusZthis_updateZnext_updater5rT)r6r7r8�single_extensionsrFNcCsht�|_xT|dD]H}|dj}d|}t||�rDt|||dj�|djr|j�|�qWd|_dS)zv
        Sets common named extensions to private attributes and creates a list
        of critical extensions
        rzr+z	_%s_valuer.r,TN)r9r:r;r<r=r>r?r@)rArBrCrDr#r#r$rE�s


zSingleResponse._set_extensionscCs|js|��|jS)z�
        Returns a set of the names (or OID if not a known extension) of the
        extensions marked as critical

        :return:
            A set of unicode strings
        )r@rEr:)rAr#r#r$rF�s
z"SingleResponse.critical_extensionscCs|jdkr|��|jS)z�
        This extension is used to locate the CRL that a certificate's revocation
        is contained within.

        :return:
            None or a CrlId object
        F)r@rE�
_crl_value)rAr#r#r$�	crl_value�s

zSingleResponse.crl_valuecCs|jdkr|��|jS)z�
        This extension is used to indicate the date at which an archived
        (historical) certificate status entry will no longer be available.

        :return:
            None or a GeneralizedTime object
        F)r@rE�_archive_cutoff_value)rAr#r#r$�archive_cutoff_value�s

z#SingleResponse.archive_cutoff_valuecCs|jdkr|��|jS)z�
        This extension indicates the reason that a certificate was revoked.

        :return:
            None or a CRLReason object
        F)r@rE�_crl_reason_value)rAr#r#r$�crl_reason_value�s	
zSingleResponse.crl_reason_valuecCs|jdkr|��|jS)a=
        This extension indicates the suspected date/time the private key was
        compromised or the certificate became invalid. This would usually be
        before the revocation date, which is when the CA processed the
        revocation.

        :return:
            None or a GeneralizedTime object
        F)r@rE�_invalidity_date_value)rAr#r#r$�invalidity_date_value�s
z$SingleResponse.invalidity_date_valuecCs|jdkr|��|jS)z�
        This extension indicates the issuer of the certificate in question.

        :return:
            None or an x509.GeneralNames object
        F)r@rE�_certificate_issuer_value)rAr#r#r$�certificate_issuer_value�s	
z'SingleResponse.certificate_issuer_value)rr r!r%rnrrxr&r@r:r{r}rr�r�rErIrFr|r~r�r�r�r#r#r#r$ryzs&
ryc@seZdZeZdS)�	ResponsesN)rr r!ryr2r#r#r#r$r��sr�c@seZdZddd�ZdS)�ResponseDataExtensionIdrQ�extended_revoke)z1.3.6.1.5.5.7.48.1.2z1.3.6.1.5.5.7.48.1.9N)rr r!r"r#r#r#r$r��sr�c@s6eZdZdefdeddifdefgZdZee	d�Z
dS)	�ResponseDataExtensionr+r,r-Fr.)r+r.)rQr�N)rr r!r�r	rr&r/rrr0r#r#r#r$r��s
r�c@seZdZeZdS)�ResponseDataExtensionsN)rr r!r�r2r#r#r#r$r�sr�c
@sBeZdZdedddd�fdefdefdefd	edd
dd�fgZd
S)�ResponseDatarWr5rr)r6r7r-Zresponder_idZproduced_atZ	responses�response_extensionsrT)r6r7r8N)	rr r!rrkrr�r�r&r#r#r#r$r�s
r�c	@s2eZdZdefdefdefdedddd�fgZd	S)
�BasicOCSPResponse�tbs_response_datar\r]r^r5rT)r6r7r8N)rr r!r�rrrZr&r#r#r#r$r�sr�c@s(eZdZdefdefgZdZdeiZdS)�
ResponseBytes�
response_type�response)r�r�rLN)	rr r!rKrr&r/r�r0r#r#r#r$r�"s
r�c@szeZdZdefdedddd�fgZdZdZdZdZ	d	d
�Z
edd��Zed
d��Z
edd��Zedd��Zedd��ZdS)�OCSPResponseZresponse_status�response_bytesr5rT)r6r7r8FNcCsvt�|_xb|ddjddD]H}|dj}d|}t||�rRt|||dj�|djr |j�|�q Wd	|_d
S)zv
        Sets common named extensions to private attributes and creates a list
        of critical extensions
        r�r�r�r�r+z	_%s_valuer.r,TN)r9r:r>r;r<r=r?r@)rArBrCrDr#r#r$rE9s


zOCSPResponse._set_extensionscCs|js|��|jS)z�
        Returns a set of the names (or OID if not a known extension) of the
        extensions marked as critical

        :return:
            A set of unicode strings
        )r@rEr:)rAr#r#r$rFKs
z OCSPResponse.critical_extensionscCs|jdkr|��|jS)z�
        This extension is used to prevent replay attacks on the request/response
        exchange

        :return:
            None or an OctetString object
        F)r@rEra)rAr#r#r$rbYs

zOCSPResponse.nonce_valuecCs|jdkr|��|jS)z�
        This extension is used to signal that the responder will return a
        "revoked" status for non-issued certificates.

        :return:
            None or a Null object (if present)
        F)r@rE�_extended_revoke_value)rAr#r#r$�extended_revoke_valuegs

z"OCSPResponse.extended_revoke_valuecCs|ddjS)z�
        A shortcut into the BasicOCSPResponse sequence

        :return:
            None or an asn1crypto.ocsp.BasicOCSPResponse object
        r�r�)r>)rAr#r#r$rLus	z OCSPResponse.basic_ocsp_responsecCs|ddjdS)z�
        A shortcut into the parsed, ResponseData sequence

        :return:
            None or an asn1crypto.ocsp.ResponseData object
        r�r�r�)r>)rAr#r#r$�
response_data�s	zOCSPResponse.response_data)rr r!rgr�r&r@r:rar�rErIrFrbr�rLr�r#r#r#r$r�.sr�N)E�__doc__Z
__future__rrrrZalgosrrZcorer	r
rrr
rrrrrrrrrrrr�keysrZx509rrrrrr%r'r(r*r1r3rJrKrMrNrOrPrTrUrVrZr[r_rgrkrmrnrprqrwrxryr�r�r�r�r�r�r�r�r#r#r#r$�<module>sT<	
9	Zx
	

Zerion Mini Shell 1.0