U
    EZhu                     @   sP   d dl Z d dlmZmZ d dlmZ G dd de jdZG dd de jdZdS )	    N)UnsupportedAlgorithm_Reasons)_serializationc                   @   sJ   e Zd Zeed dddZejej	ej
edddZeddd	Zd
S )X448PublicKeydatareturnc                 C   s*   ddl m} | s tdtj||S Nr   )backendz1X448 is not supported by this version of OpenSSL.),cryptography.hazmat.backends.openssl.backendr
   x448_supportedr   r   UNSUPPORTED_EXCHANGE_ALGORITHMZx448_load_public_bytesclsr   r
    r   u/home/aprabhat/apps/x.techxrdev.in/venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/x448.pyfrom_public_bytes   s    zX448PublicKey.from_public_bytes)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   |  tjjtjjS )z`
        The raw bytes of the public key.
        Equivalent to public_bytes(Raw, Raw).
        )r   r   EncodingRawPublicFormatr   r   r   r   public_bytes_raw#   s     zX448PublicKey.public_bytes_rawN)__name__
__module____qualname__classmethodbytesr   abcabstractmethodr   r   r   r   r   r   r   r   r   r      s   	r   )	metaclassc                   @   s   e Zd Zed dddZeed dddZeje	dddZ
ejejejejed	d
dZedddZeje	edddZdS )X448PrivateKeyr   c                 C   s(   ddl m} | s tdtj| S r	   )r   r
   r   r   r   r   Zx448_generate_key)r   r
   r   r   r   generate.   s    zX448PrivateKey.generater   c                 C   s*   ddl m} | s tdtj||S r	   )r   r
   r   r   r   r   Zx448_load_private_bytesr   r   r   r   from_private_bytes9   s    z!X448PrivateKey.from_private_bytesc                 C   s   dS )zI
        Returns the public key associated with this private key
        Nr   r   r   r   r   
public_keyE   s    zX448PrivateKey.public_key)r   r   encryption_algorithmr   c                 C   s   dS )z:
        The serialized bytes of the private key.
        Nr   )r   r   r   r)   r   r   r   private_bytesK   s    zX448PrivateKey.private_bytesc                 C   s   |  tjjtjjt S )zr
        The raw bytes of the private key.
        Equivalent to private_bytes(Raw, Raw, NoEncryption()).
        )r*   r   r   r   PrivateFormatZNoEncryptionr   r   r   r   private_bytes_rawV   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   exchangea   s    zX448PrivateKey.exchangeN)r   r   r   r    r&   r!   r'   r"   r#   r   r(   r   r   r+   ZKeySerializationEncryptionr*   r,   r.   r   r   r   r   r%   -   s   

r%   )	r"   Zcryptography.exceptionsr   r   Zcryptography.hazmat.primitivesr   ABCMetar   r%   r   r   r   r   <module>   s   !