σ
KΦVc           @` s  d  d l  m Z m Z m Z d  d l Z d  d l Z e j e j  d e f d     Y Z	 e j e j  d e f d     Y Z
 e j e j  d e f d     Y Z e j e j  d	 e f d
     Y Z e j e j  d e f d     Y Z e j e j  d e f d     Y Z e j e j  d e f d     Y Z e j e j  d e f d     Y Z e j e j  d e f d     Y Z e j e j  d e f d     Y Z e j e j  d e f d     Y Z e j e j  d e f d     Y Z d S(   i    (   t   absolute_importt   divisiont   print_functionNt   CipherBackendc           B` s>   e  Z e j d     Z e j d    Z e j d    Z RS(   c         C` s   d S(   sI   
        Return True if the given cipher and mode are supported.
        N(    (   t   selft   ciphert   mode(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   cipher_supported   s    c         C` s   d S(   sF   
        Get a CipherContext that can be used for encryption.
        N(    (   R   R   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   create_symmetric_encryption_ctx   s    c         C` s   d S(   sF   
        Get a CipherContext that can be used for decryption.
        N(    (   R   R   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   create_symmetric_decryption_ctx   s    (   t   __name__t
   __module__t   abct   abstractmethodR   R   R	   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyR      s   t   HashBackendc           B` s,   e  Z e j d     Z e j d    Z RS(   c         C` s   d S(   sQ   
        Return True if the hash algorithm is supported by this backend.
        N(    (   R   t	   algorithm(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   hash_supported#   s    c         C` s   d S(   sH   
        Create a HashContext for calculating a message digest.
        N(    (   R   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   create_hash_ctx)   s    (   R
   R   R   R   R   R   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyR   !   s   t   HMACBackendc           B` s,   e  Z e j d     Z e j d    Z RS(   c         C` s   d S(   sb   
        Return True if the hash algorithm is supported for HMAC by this
        backend.
        N(    (   R   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   hmac_supported2   s    c         C` s   d S(   sT   
        Create a MACContext for calculating a message authentication code.
        N(    (   R   t   keyR   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   create_hmac_ctx9   s    (   R
   R   R   R   R   R   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyR   0   s   t   CMACBackendc           B` s,   e  Z e j d     Z e j d    Z RS(   c         C` s   d S(   sX   
        Returns True if the block cipher is supported for CMAC by this backend
        N(    (   R   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   cmac_algorithm_supportedB   s    c         C` s   d S(   sT   
        Create a MACContext for calculating a message authentication code.
        N(    (   R   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   create_cmac_ctxH   s    (   R
   R   R   R   R   R   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyR   @   s   t   PBKDF2HMACBackendc           B` s,   e  Z e j d     Z e j d    Z RS(   c         C` s   d S(   sd   
        Return True if the hash algorithm is supported for PBKDF2 by this
        backend.
        N(    (   R   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   pbkdf2_hmac_supportedQ   s    c         C` s   d S(   sN   
        Return length bytes derived from provided PBKDF2 parameters.
        N(    (   R   R   t   lengtht   saltt
   iterationst   key_material(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   derive_pbkdf2_hmacX   s    (   R
   R   R   R   R   R   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyR   O   s   t
   RSABackendc           B` sb   e  Z e j d     Z e j d    Z e j d    Z e j d    Z e j d    Z RS(   c         C` s   d S(   sq   
        Generate an RSAPrivateKey instance with public_exponent and a modulus
        of key_size bits.
        N(    (   R   t   public_exponentt   key_size(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   generate_rsa_private_keyb   s    c         C` s   d S(   sQ   
        Returns True if the backend supports the given padding options.
        N(    (   R   t   padding(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   rsa_padding_supportedi   s    c         C` s   d S(   sg   
        Returns True if the backend supports the given parameters for key
        generation.
        N(    (   R   R!   R"   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt!   generate_rsa_parameters_supportedo   s    c         C` s   d S(   s4   
        Returns an RSAPrivateKey provider.
        N(    (   R   t   numbers(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_rsa_private_numbersv   s    c         C` s   d S(   s3   
        Returns an RSAPublicKey provider.
        N(    (   R   R'   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_rsa_public_numbers|   s    (	   R
   R   R   R   R#   R%   R&   R(   R)   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyR    `   s
   t
   DSABackendc           B` s   e  Z e j d     Z e j d    Z e j d    Z e j d    Z e j d    Z e j d    Z	 e j d    Z
 e j d    Z RS(   c         C` s   d S(   sT   
        Generate a DSAParameters instance with a modulus of key_size bits.
        N(    (   R   R"   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   generate_dsa_parameters   s    c         C` s   d S(   sf   
        Generate a DSAPrivateKey instance with parameters as a DSAParameters
        object.
        N(    (   R   t
   parameters(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   generate_dsa_private_key   s    c         C` s   d S(   sH   
        Generate a DSAPrivateKey instance using key size only.
        N(    (   R   R"   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt'   generate_dsa_private_key_and_parameters   s    c         C` s   d S(   sX   
        Return True if the hash algorithm is supported by the backend for DSA.
        N(    (   R   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   dsa_hash_supported   s    c         C` s   d S(   sU   
        Return True if the parameters are supported by the backend for DSA.
        N(    (   R   t   pt   qt   g(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   dsa_parameters_supported   s    c         C` s   d S(   s3   
        Returns a DSAPrivateKey provider.
        N(    (   R   R'   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_dsa_private_numbers€   s    c         C` s   d S(   s2   
        Returns a DSAPublicKey provider.
        N(    (   R   R'   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_dsa_public_numbersͺ   s    c         C` s   d S(   s3   
        Returns a DSAParameters provider.
        N(    (   R   R'   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_dsa_parameter_numbers°   s    (   R
   R   R   R   R+   R-   R.   R/   R3   R4   R5   R6   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyR*      s   t   EllipticCurveBackendc           B` st   e  Z e j d     Z e j d    Z e j d    Z e j d    Z e j d    Z e j d    Z	 RS(   c         C` s   d S(   s   
        Returns True if the backend supports the named elliptic curve with the
        specified signature algorithm.
        N(    (   R   t   signature_algorithmt   curve(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt,   elliptic_curve_signature_algorithm_supportedΉ   s    c         C` s   d S(   sP   
        Returns True if the backend supports the named elliptic curve.
        N(    (   R   R9   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   elliptic_curve_supportedΒ   s    c         C` s   d S(   sW   
        Return an object conforming to the EllipticCurvePrivateKey interface.
        N(    (   R   R9   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt#   generate_elliptic_curve_private_keyΘ   s    c         C` s   d S(   sT   
        Return an EllipticCurvePublicKey provider using the given numbers.
        N(    (   R   R'   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt"   load_elliptic_curve_public_numbersΞ   s    c         C` s   d S(   sU   
        Return an EllipticCurvePrivateKey provider using the given numbers.
        N(    (   R   R'   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt#   load_elliptic_curve_private_numbersΤ   s    c         C` s   d S(   sV   
        Returns whether the exchange algorithm is supported by this backend.
        N(    (   R   R   R9   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt+   elliptic_curve_exchange_algorithm_supportedΪ   s    (
   R
   R   R   R   R:   R;   R<   R=   R>   R?   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyR7   ·   s   	t   PEMSerializationBackendc           B` s,   e  Z e j d     Z e j d    Z RS(   c         C` s   d S(   sz   
        Loads a private key from PEM encoded data, using the provided password
        if the data is encrypted.
        N(    (   R   t   datat   password(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_pem_private_keyγ   s    c         C` s   d S(   s;   
        Loads a public key from PEM encoded data.
        N(    (   R   RA   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_pem_public_keyκ   s    (   R
   R   R   R   RC   RD   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyR@   α   s   t   DERSerializationBackendc           B` s,   e  Z e j d     Z e j d    Z RS(   c         C` s   d S(   sy   
        Loads a private key from DER encoded data. Uses the provided password
        if the data is encrypted.
        N(    (   R   RA   RB   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_der_private_keyσ   s    c         C` s   d S(   s;   
        Loads a public key from DER encoded data.
        N(    (   R   RA   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_der_public_keyϊ   s    (   R
   R   R   R   RF   RG   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyRE   ρ   s   t   X509Backendc           B` s   e  Z e j d     Z e j d    Z e j d    Z e j d    Z e j d    Z e j d    Z	 e j d    Z
 e j d    Z RS(   c         C` s   d S(   sB   
        Load an X.509 certificate from PEM encoded data.
        N(    (   R   RA   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_pem_x509_certificate  s    c         C` s   d S(   sB   
        Load an X.509 certificate from DER encoded data.
        N(    (   R   RA   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_der_x509_certificate	  s    c         C` s   d S(   s:   
        Load an X.509 CSR from DER encoded data.
        N(    (   R   RA   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_der_x509_csr  s    c         C` s   d S(   s:   
        Load an X.509 CSR from PEM encoded data.
        N(    (   R   RA   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_pem_x509_csr  s    c         C` s   d S(   sI   
        Create and sign an X.509 CSR from a CSR builder object.
        N(    (   R   t   buildert   private_keyR   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   create_x509_csr  s    c         C` s   d S(   sX   
        Create and sign an X.509 certificate from a CertificateBuilder object.
        N(    (   R   RM   RN   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   create_x509_certificate!  s    c         C` s   d S(   s|   
        Create and sign an X.509 CertificateRevocationList from a
        CertificateRevocationListBuilder object.
        N(    (   R   RM   RN   R   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   create_x509_crl'  s    c         C` s   d S(   se   
        Create a RevokedCertificate object from a RevokedCertificateBuilder
        object.
        N(    (   R   RM   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   create_x509_revoked_certificate.  s    (   R
   R   R   R   RI   RJ   RK   RL   RO   RP   RQ   RR   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyRH     s   t	   DHBackendc           B` s   e  Z e j d     Z e j d    Z e j d    Z e j d    Z e j d    Z e j d    Z	 e j d    Z
 e j d    Z RS(   c         C` s   d S(   sS   
        Generate a DHParameters instance with a modulus of key_size bits.
        N(    (   R   R"   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   generate_dh_parameters8  s    c         C` s   d S(   sd   
        Generate a DHPrivateKey instance with parameters as a DHParameters
        object.
        N(    (   R   R,   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   generate_dh_private_key>  s    c         C` s   d S(   sG   
        Generate a DHPrivateKey instance using key size only.
        N(    (   R   R"   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt&   generate_dh_private_key_and_parametersE  s    c         C` s   d S(   s2   
        Returns a DHPrivateKey provider.
        N(    (   R   R'   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_dh_private_numbersK  s    c         C` s   d S(   s1   
        Returns a DHPublicKey provider.
        N(    (   R   R'   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_dh_public_numbersQ  s    c         C` s   d S(   s2   
        Returns a DHParameters provider.
        N(    (   R   R'   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   load_dh_parameter_numbersW  s    c         C` s   d S(   sV   
        Returns whether the exchange algorithm is supported by this backend.
        N(    (   R   t   exchange_algorithm(    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   dh_exchange_algorithm_supported]  s    c         C` s   d S(   sV   
        Returns whether the backend supports DH with these parameter values.
        N(    (   R   R0   R2   (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   dh_parameters_supportedc  s    (   R
   R   R   R   RT   RU   RV   RW   RX   RY   R[   R\   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyRS   6  s   (   t
   __future__R    R   R   R   t   sixt   add_metaclasst   ABCMetat   objectR   R   R   R   R   R    R*   R7   R@   RE   RH   RS   (    (    (    sK   /usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/interfaces.pyt   <module>   s4   "3)4