U
    Á“«jI  ã                   @  s¤   d dl mZ d dlZd dlmZmZ d dlmZ d dl	m
Z
 d dlmZ G dd„ dejd	�Zeed
ƒrte ejj¡ G dd„ dejd	�Zeed
ƒr e ejj¡ dS )é    )ÚannotationsN)ÚUnsupportedAlgorithmÚ_Reasons)Úopenssl)Ú_serialization)ÚBufferc                   @  sŒ   e Zd Zedd dœdd„ƒZejddddœdd	„ƒZejdd
œdd„ƒZejdddœdd„ƒZ	ejd d
œdd„ƒZ
ejdd dœdd„ƒZdS )ÚX448PublicKeyÚbytes©ÚdataÚreturnc                 C  s,   ddl m} | ¡ s tdtjƒ‚tj |¡S ©Nr   )Úbackendz1X448 is not supported by this version of OpenSSL.)	Ú,cryptography.hazmat.backends.openssl.backendr   Úx448_supportedr   r   ÚUNSUPPORTED_EXCHANGE_ALGORITHMÚrust_opensslÚx448Úfrom_public_bytes©Úclsr   r   © r   úR/tmp/pip-unpacked-wheel-w0_gbkxc/cryptography/hazmat/primitives/asymmetric/x448.pyr      s    þzX448PublicKey.from_public_bytesú_serialization.Encodingz_serialization.PublicFormat)ÚencodingÚformatr   c                 C  s   dS )z9
        The serialized bytes of the public key.
        Nr   )Úselfr   r   r   r   r   Úpublic_bytes   s    zX448PublicKey.public_bytes©r   c                 C  s   dS )z`
        The raw bytes of the public key.
        Equivalent to public_bytes(Raw, Raw).
        Nr   ©r   r   r   r   Úpublic_bytes_raw&   s    zX448PublicKey.public_bytes_rawÚobjectÚbool)Úotherr   c                 C  s   dS )z"
        Checks equality.
        Nr   )r   r#   r   r   r   Ú__eq__-   s    zX448PublicKey.__eq__c                 C  s   dS ©z!
        Returns a copy.
        Nr   r   r   r   r   Ú__copy__3   s    zX448PublicKey.__copy__Údict©Úmemor   c                 C  s   dS ©z&
        Returns a deep copy.
        Nr   ©r   r)   r   r   r   Ú__deepcopy__9   s    zX448PublicKey.__deepcopy__N)Ú__name__Ú
__module__Ú__qualname__Úclassmethodr   ÚabcÚabstractmethodr   r    r$   r&   r,   r   r   r   r   r      s   	r   )Ú	metaclassr   c                   @  s´   e Zd Zed dœdd„ƒZedd dœdd„ƒZejddœd	d
„ƒZejdddddœdd„ƒZ	ejddœdd„ƒZ
ejdddœdd„ƒZejd dœdd„ƒZejdd dœdd„ƒZdS )ÚX448PrivateKeyr   c                 C  s*   ddl m} | ¡ s tdtjƒ‚tj ¡ S r   )	r   r   r   r   r   r   r   r   Zgenerate_key)r   r   r   r   r   ÚgenerateE   s    þzX448PrivateKey.generater   r
   c                 C  s,   ddl m} | ¡ s tdtjƒ‚tj |¡S r   )	r   r   r   r   r   r   r   r   Úfrom_private_bytesr   r   r   r   r6   Q   s    þz!X448PrivateKey.from_private_bytesr   c                 C  s   dS )zI
        Returns the public key associated with this private key
        Nr   r   r   r   r   Ú
public_key]   s    zX448PrivateKey.public_keyr   z_serialization.PrivateFormatz)_serialization.KeySerializationEncryptionr	   )r   r   Úencryption_algorithmr   c                 C  s   dS )z:
        The serialized bytes of the private key.
        Nr   )r   r   r   r8   r   r   r   Úprivate_bytesc   s    zX448PrivateKey.private_bytesc                 C  s   dS )zr
        The raw bytes of the private key.
        Equivalent to private_bytes(Raw, Raw, NoEncryption()).
        Nr   r   r   r   r   Úprivate_bytes_rawn   s    z X448PrivateKey.private_bytes_raw)Úpeer_public_keyr   c                 C  s   dS )zY
        Performs a key exchange operation using the provided peer's public key.
        Nr   )r   r;   r   r   r   Úexchangeu   s    zX448PrivateKey.exchangec                 C  s   dS r%   r   r   r   r   r   r&   {   s    zX448PrivateKey.__copy__r'   r(   c                 C  s   dS r*   r   r+   r   r   r   r,   �   s    zX448PrivateKey.__deepcopy__N)r-   r.   r/   r0   r5   r6   r1   r2   r7   r9   r:   r<   r&   r,   r   r   r   r   r4   D   s    
r4   )Ú
__future__r   r1   Zcryptography.exceptionsr   r   Z"cryptography.hazmat.bindings._rustr   r   Zcryptography.hazmat.primitivesr   Zcryptography.utilsr   ÚABCMetar   ÚhasattrÚregisterr   r4   r   r   r   r   Ú<module>   s   1
D
