Your IP : 18.191.218.234


Current Path : /lib64/python3.6/site-packages/cryptography/hazmat/backends/__pycache__/
Upload File :
Current File : //lib64/python3.6/site-packages/cryptography/hazmat/backends/__pycache__/interfaces.cpython-36.pyc

3

l�_*�@s�ddlmZmZmZddlZddlZejej�Gdd�de��Z	ejej�Gdd�de��Z
ejej�Gdd�de��Zejej�Gd	d
�d
e��Zejej�Gdd�de��Z
ejej�Gd
d�de��Zejej�Gdd�de��Zejej�Gdd�de��Zejej�Gdd�de��Zejej�Gdd�de��Zejej�Gdd�de��Zejej�Gdd�de��Zejej�Gdd�de��ZdS)�)�absolute_import�division�print_functionNc@s6eZdZejdd��Zejdd��Zejdd��ZdS)�
CipherBackendcCsdS)zI
        Return True if the given cipher and mode are supported.
        N�)�self�cipher�moderr�"/usr/lib64/python3.6/interfaces.py�cipher_supportedszCipherBackend.cipher_supportedcCsdS)zF
        Get a CipherContext that can be used for encryption.
        Nr)rrr	rrr
�create_symmetric_encryption_ctxsz-CipherBackend.create_symmetric_encryption_ctxcCsdS)zF
        Get a CipherContext that can be used for decryption.
        Nr)rrr	rrr
�create_symmetric_decryption_ctxsz-CipherBackend.create_symmetric_decryption_ctxN)�__name__�
__module__�__qualname__�abc�abstractmethodrrr
rrrr
rsrc@s(eZdZejdd��Zejdd��ZdS)�HashBackendcCsdS)zQ
        Return True if the hash algorithm is supported by this backend.
        Nr)r�	algorithmrrr
�hash_supported#szHashBackend.hash_supportedcCsdS)zH
        Create a HashContext for calculating a message digest.
        Nr)rrrrr
�create_hash_ctx)szHashBackend.create_hash_ctxN)rrrrrrrrrrr
r!src@s(eZdZejdd��Zejdd��ZdS)�HMACBackendcCsdS)zb
        Return True if the hash algorithm is supported for HMAC by this
        backend.
        Nr)rrrrr
�hmac_supported2szHMACBackend.hmac_supportedcCsdS)zQ
        Create a context for calculating a message authentication code.
        Nr)r�keyrrrr
�create_hmac_ctx9szHMACBackend.create_hmac_ctxN)rrrrrrrrrrr
r0src@s(eZdZejdd��Zejdd��ZdS)�CMACBackendcCsdS)zX
        Returns True if the block cipher is supported for CMAC by this backend
        Nr)rrrrr
�cmac_algorithm_supportedBsz$CMACBackend.cmac_algorithm_supportedcCsdS)zQ
        Create a context for calculating a message authentication code.
        Nr)rrrrr
�create_cmac_ctxHszCMACBackend.create_cmac_ctxN)rrrrrrrrrrr
r@src@s(eZdZejdd��Zejdd��ZdS)�PBKDF2HMACBackendcCsdS)zd
        Return True if the hash algorithm is supported for PBKDF2 by this
        backend.
        Nr)rrrrr
�pbkdf2_hmac_supportedQsz'PBKDF2HMACBackend.pbkdf2_hmac_supportedcCsdS)zN
        Return length bytes derived from provided PBKDF2 parameters.
        Nr)rr�length�saltZ
iterations�key_materialrrr
�derive_pbkdf2_hmacXsz$PBKDF2HMACBackend.derive_pbkdf2_hmacN)rrrrrrr#rrrr
rOsrc@sReZdZejdd��Zejdd��Zejdd��Zejdd��Zejd	d
��Z	dS)�
RSABackendcCsdS)zq
        Generate an RSAPrivateKey instance with public_exponent and a modulus
        of key_size bits.
        Nr)r�public_exponent�key_sizerrr
�generate_rsa_private_keycsz#RSABackend.generate_rsa_private_keycCsdS)zQ
        Returns True if the backend supports the given padding options.
        Nr)rZpaddingrrr
�rsa_padding_supportedjsz RSABackend.rsa_padding_supportedcCsdS)zg
        Returns True if the backend supports the given parameters for key
        generation.
        Nr)rr%r&rrr
�!generate_rsa_parameters_supportedpsz,RSABackend.generate_rsa_parameters_supportedcCsdS)z4
        Returns an RSAPrivateKey provider.
        Nr)r�numbersrrr
�load_rsa_private_numberswsz#RSABackend.load_rsa_private_numberscCsdS)z3
        Returns an RSAPublicKey provider.
        Nr)rr*rrr
�load_rsa_public_numbers}sz"RSABackend.load_rsa_public_numbersN)
rrrrrr'r(r)r+r,rrrr
r$as
r$c@s|eZdZejdd��Zejdd��Zejdd��Zejdd��Zejd	d
��Z	ejdd��Z
ejd
d��Zejdd��ZdS)�
DSABackendcCsdS)zT
        Generate a DSAParameters instance with a modulus of key_size bits.
        Nr)rr&rrr
�generate_dsa_parameters�sz"DSABackend.generate_dsa_parameterscCsdS)zf
        Generate a DSAPrivateKey instance with parameters as a DSAParameters
        object.
        Nr)r�
parametersrrr
�generate_dsa_private_key�sz#DSABackend.generate_dsa_private_keycCsdS)zH
        Generate a DSAPrivateKey instance using key size only.
        Nr)rr&rrr
�'generate_dsa_private_key_and_parameters�sz2DSABackend.generate_dsa_private_key_and_parameterscCsdS)zX
        Return True if the hash algorithm is supported by the backend for DSA.
        Nr)rrrrr
�dsa_hash_supported�szDSABackend.dsa_hash_supportedcCsdS)zU
        Return True if the parameters are supported by the backend for DSA.
        Nr)r�p�q�grrr
�dsa_parameters_supported�sz#DSABackend.dsa_parameters_supportedcCsdS)z3
        Returns a DSAPrivateKey provider.
        Nr)rr*rrr
�load_dsa_private_numbers�sz#DSABackend.load_dsa_private_numberscCsdS)z2
        Returns a DSAPublicKey provider.
        Nr)rr*rrr
�load_dsa_public_numbers�sz"DSABackend.load_dsa_public_numberscCsdS)z3
        Returns a DSAParameters provider.
        Nr)rr*rrr
�load_dsa_parameter_numbers�sz%DSABackend.load_dsa_parameter_numbersN)
rrrrrr.r0r1r2r6r7r8r9rrrr
r-�sr-c@sneZdZejdd��Zejdd��Zejdd��Zejdd��Zejd	d
��Z	ejdd��Z
ejd
d��ZdS)�EllipticCurveBackendcCsdS)z
        Returns True if the backend supports the named elliptic curve with the
        specified signature algorithm.
        Nr)rZsignature_algorithm�curverrr
�,elliptic_curve_signature_algorithm_supported�szAEllipticCurveBackend.elliptic_curve_signature_algorithm_supportedcCsdS)zP
        Returns True if the backend supports the named elliptic curve.
        Nr)rr;rrr
�elliptic_curve_supported�sz-EllipticCurveBackend.elliptic_curve_supportedcCsdS)zW
        Return an object conforming to the EllipticCurvePrivateKey interface.
        Nr)rr;rrr
�#generate_elliptic_curve_private_key�sz8EllipticCurveBackend.generate_elliptic_curve_private_keycCsdS)zT
        Return an EllipticCurvePublicKey provider using the given numbers.
        Nr)rr*rrr
�"load_elliptic_curve_public_numbers�sz7EllipticCurveBackend.load_elliptic_curve_public_numberscCsdS)zU
        Return an EllipticCurvePrivateKey provider using the given numbers.
        Nr)rr*rrr
�#load_elliptic_curve_private_numbers�sz8EllipticCurveBackend.load_elliptic_curve_private_numberscCsdS)zV
        Returns whether the exchange algorithm is supported by this backend.
        Nr)rrr;rrr
�+elliptic_curve_exchange_algorithm_supported�sz@EllipticCurveBackend.elliptic_curve_exchange_algorithm_supportedcCsdS)zL
        Compute the private key given the private value and curve.
        Nr)rZ
private_valuer;rrr
�!derive_elliptic_curve_private_key�sz6EllipticCurveBackend.derive_elliptic_curve_private_keyN)rrrrrr<r=r>r?r@rArBrrrr
r:�s	r:c@s6eZdZejdd��Zejdd��Zejdd��ZdS)�PEMSerializationBackendcCsdS)zz
        Loads a private key from PEM encoded data, using the provided password
        if the data is encrypted.
        Nr)r�data�passwordrrr
�load_pem_private_key�sz,PEMSerializationBackend.load_pem_private_keycCsdS)z;
        Loads a public key from PEM encoded data.
        Nr)rrDrrr
�load_pem_public_key�sz+PEMSerializationBackend.load_pem_public_keycCsdS)zC
        Load encryption parameters from PEM encoded data.
        Nr)rrDrrr
�load_pem_parameters�sz+PEMSerializationBackend.load_pem_parametersN)rrrrrrFrGrHrrrr
rC�srCc@s6eZdZejdd��Zejdd��Zejdd��ZdS)�DERSerializationBackendcCsdS)zy
        Loads a private key from DER encoded data. Uses the provided password
        if the data is encrypted.
        Nr)rrDrErrr
�load_der_private_keysz,DERSerializationBackend.load_der_private_keycCsdS)z;
        Loads a public key from DER encoded data.
        Nr)rrDrrr
�load_der_public_keysz+DERSerializationBackend.load_der_public_keycCsdS)zC
        Load encryption parameters from DER encoded data.
        Nr)rrDrrr
�load_der_parameters
sz+DERSerializationBackend.load_der_parametersN)rrrrrrJrKrLrrrr
rI�srIc@s�eZdZejdd��Zejdd��Zejdd��Zejdd��Zejd	d
��Z	ejdd��Z
ejd
d��Zejdd��Zejdd��Z
dS)�X509BackendcCsdS)zB
        Load an X.509 certificate from PEM encoded data.
        Nr)rrDrrr
�load_pem_x509_certificatesz%X509Backend.load_pem_x509_certificatecCsdS)zB
        Load an X.509 certificate from DER encoded data.
        Nr)rrDrrr
�load_der_x509_certificatesz%X509Backend.load_der_x509_certificatecCsdS)z:
        Load an X.509 CSR from DER encoded data.
        Nr)rrDrrr
�load_der_x509_csr"szX509Backend.load_der_x509_csrcCsdS)z:
        Load an X.509 CSR from PEM encoded data.
        Nr)rrDrrr
�load_pem_x509_csr(szX509Backend.load_pem_x509_csrcCsdS)zI
        Create and sign an X.509 CSR from a CSR builder object.
        Nr)r�builder�private_keyrrrr
�create_x509_csr.szX509Backend.create_x509_csrcCsdS)zX
        Create and sign an X.509 certificate from a CertificateBuilder object.
        Nr)rrRrSrrrr
�create_x509_certificate4sz#X509Backend.create_x509_certificatecCsdS)z|
        Create and sign an X.509 CertificateRevocationList from a
        CertificateRevocationListBuilder object.
        Nr)rrRrSrrrr
�create_x509_crl:szX509Backend.create_x509_crlcCsdS)ze
        Create a RevokedCertificate object from a RevokedCertificateBuilder
        object.
        Nr)rrRrrr
�create_x509_revoked_certificateAsz+X509Backend.create_x509_revoked_certificatecCsdS)zG
        Compute the DER encoded bytes of an X509 Name object.
        Nr)r�namerrr
�x509_name_bytesHszX509Backend.x509_name_bytesN)rrrrrrNrOrPrQrTrUrVrWrYrrrr
rMsrMc@s~eZdZejdd��Zejdd��Zejdd��Zejdd��Zejd	d
��Z	ejdd��Z
ejddd��Zejdd��Zd
S)�	DHBackendcCsdS)z�
        Generate a DHParameters instance with a modulus of key_size bits.
        Using the given generator. Often 2 or 5.
        Nr)r�	generatorr&rrr
�generate_dh_parametersQsz DHBackend.generate_dh_parameterscCsdS)zd
        Generate a DHPrivateKey instance with parameters as a DHParameters
        object.
        Nr)rr/rrr
�generate_dh_private_keyXsz!DHBackend.generate_dh_private_keycCsdS)zx
        Generate a DHPrivateKey instance using key size only.
        Using the given generator. Often 2 or 5.
        Nr)rr[r&rrr
�&generate_dh_private_key_and_parameters_sz0DHBackend.generate_dh_private_key_and_parameterscCsdS)z;
        Load a DHPrivateKey from DHPrivateNumbers
        Nr)rr*rrr
�load_dh_private_numbersfsz!DHBackend.load_dh_private_numberscCsdS)z:
        Load a DHPublicKey from DHPublicNumbers.
        Nr)rr*rrr
�load_dh_public_numberslsz DHBackend.load_dh_public_numberscCsdS)z<
        Load DHParameters from DHParameterNumbers.
        Nr)rr*rrr
�load_dh_parameter_numbersrsz#DHBackend.load_dh_parameter_numbersNcCsdS)zV
        Returns whether the backend supports DH with these parameter values.
        Nr)rr3r5r4rrr
�dh_parameters_supportedxsz!DHBackend.dh_parameters_supportedcCsdS)zw
        Returns True if the backend supports the serialization of DH objects
        with subgroup order (q).
        Nr)rrrr
�dh_x942_serialization_supported~sz)DHBackend.dh_x942_serialization_supported)N)
rrrrrr\r]r^r_r`rarbrcrrrr
rZOsrZc@seZdZejdd��ZdS)�
ScryptBackendcCsdS)zG
        Return bytes derived from provided Scrypt parameters.
        Nr)rr"r!r �n�rr3rrr
�
derive_scrypt�szScryptBackend.derive_scryptN)rrrrrrgrrrr
rd�srd)Z
__future__rrrrZsixZ
add_metaclass�ABCMeta�objectrrrrrr$r-r:rCrIrMrZrdrrrr
�<module>s8"3/:6

?>