o
    Z2h                     @  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jj G d
d dejd	Zeejj dS )    )annotationsN)UnsupportedAlgorithm_Reasons)openssl)_serialization)Bufferc                   @  sZ   e Zd ZedddZejdd
dZejdddZejdddZ	ejdddZ
dS )X25519PublicKeydatabytesreturnc                 C  ,   ddl m} | stdtjtj|S Nr   )backendz3X25519 is not supported by this version of OpenSSL.)	,cryptography.hazmat.backends.openssl.backendr   x25519_supportedr   r   UNSUPPORTED_EXCHANGE_ALGORITHMrust_opensslx25519from_public_bytesclsr	   r    r   /home/skpark/git/infrasmart_work/infrasmart/venv/lib/python3.10/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.pyr         z!X25519PublicKey.from_public_bytesencoding_serialization.Encodingformat_serialization.PublicFormatc                 C     dS )z9
        The serialized bytes of the public key.
        Nr   )selfr   r   r   r   r   public_bytes       zX25519PublicKey.public_bytesc                 C  r   )z`
        The raw bytes of the public key.
        Equivalent to public_bytes(Raw, Raw).
        Nr   r   r   r   r   public_bytes_raw&   r!   z X25519PublicKey.public_bytes_rawotherobjectboolc                 C  r   )z"
        Checks equality.
        Nr   )r   r$   r   r   r   __eq__-   r!   zX25519PublicKey.__eq__c                 C  r   z!
        Returns a copy.
        Nr   r"   r   r   r   __copy__3   r!   zX25519PublicKey.__copy__N)r	   r
   r   r   )r   r   r   r   r   r
   r   r
   )r$   r%   r   r&   r   r   )__name__
__module____qualname__classmethodr   abcabstractmethodr    r#   r'   r)   r   r   r   r   r      s    	r   )	metaclassc                   @  sx   e Zd ZedddZedddZejdd	d
ZejdddZ	ejd ddZ
ejd!ddZejdddZdS )"X25519PrivateKeyr   c                 C  s*   ddl m} | stdtjtj S r   )	r   r   r   r   r   r   r   r   generate_key)r   r   r   r   r   generate>   s   
zX25519PrivateKey.generater	   r   c                 C  r   r   )	r   r   r   r   r   r   r   r   from_private_bytesr   r   r   r   r6   I   r   z#X25519PrivateKey.from_private_bytesr   c                 C  r   )zI
        Returns the public key associated with this private key
        Nr   r"   r   r   r   
public_keyU   r!   zX25519PrivateKey.public_keyr   r   r   _serialization.PrivateFormatencryption_algorithm)_serialization.KeySerializationEncryptionr
   c                 C  r   )z:
        The serialized bytes of the private key.
        Nr   )r   r   r   r9   r   r   r   private_bytes[   r!   zX25519PrivateKey.private_bytesc                 C  r   )zr
        The raw bytes of the private key.
        Equivalent to private_bytes(Raw, Raw, NoEncryption()).
        Nr   r"   r   r   r   private_bytes_rawf   r!   z"X25519PrivateKey.private_bytes_rawpeer_public_keyc                 C  r   )zY
        Performs a key exchange operation using the provided peer's public key.
        Nr   )r   r=   r   r   r   exchangem   r!   zX25519PrivateKey.exchangec                 C  r   r(   r   r"   r   r   r   r)   s   r!   zX25519PrivateKey.__copy__N)r   r3   )r	   r   r   r3   r+   )r   r   r   r8   r9   r:   r   r
   r*   )r=   r   r   r
   )r,   r-   r.   r/   r5   r6   r0   r1   r7   r;   r<   r>   r)   r   r   r   r   r3   =   s    

r3   )
__future__r   r0   cryptography.exceptionsr   r   "cryptography.hazmat.bindings._rustr   r   cryptography.hazmat.primitivesr   cryptography.utilsr   ABCMetar   registerr   r3   r   r   r   r   <module>   s   +=