B
    `
                 @   sX   d dl Z d dlmZmZ d dlmZ dZdZG dd de jdZ	G d	d
 d
e jdZ
dS )    N)UnsupportedAlgorithm_Reasons)_serialization    @   c               @   sT   e Zd Zeed dddZejej	ej
edddZejeeddd	d
ZdS )Ed25519PublicKey)datareturnc             C   s*   ddl m} | s tdtj||S )Nr   )backendz4ed25519 is not supported by this version of OpenSSL.),cryptography.hazmat.backends.openssl.backendr
   ed25519_supportedr   r    UNSUPPORTED_PUBLIC_KEY_ALGORITHMZed25519_load_public_bytes)clsr   r
    r   `/home/dcms/DCMS/lib/python3.7/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.pyfrom_public_bytes   s    z"Ed25519PublicKey.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Ed25519PublicKey.public_bytesN)	signaturer   r	   c             C   s   dS )z'
        Verify the signature.
        Nr   )r   r   r   r   r   r   verify'   s    zEd25519PublicKey.verify)__name__
__module____qualname__classmethodbytesr   abcabstractmethodr   EncodingZPublicFormatr   r   r   r   r   r   r      s   r   )	metaclassc               @   sz   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d	d
dZejeedddZdS )Ed25519PrivateKey)r	   c             C   s(   ddl m} | s tdtj| S )Nr   )r
   z4ed25519 is not supported by this version of OpenSSL.)r   r
   r   r   r   r   Zed25519_generate_key)r   r
   r   r   r   generate/   s    zEd25519PrivateKey.generate)r   r	   c             C   s*   ddl m} | s tdtj||S )Nr   )r
   z4ed25519 is not supported by this version of OpenSSL.)r   r
   r   r   r   r   Zed25519_load_private_bytes)r   r   r
   r   r   r   from_private_bytes;   s    z$Ed25519PrivateKey.from_private_bytesc             C   s   dS )zD
        The Ed25519PublicKey derived from the private key.
        Nr   )r   r   r   r   
public_keyG   s    zEd25519PrivateKey.public_key)r   r   encryption_algorithmc             C   s   dS )z:
        The serialized bytes of the private key.
        Nr   )r   r   r   r%   r   r   r   private_bytesM   s    	zEd25519PrivateKey.private_bytesc             C   s   dS )z!
        Signs the data.
        Nr   )r   r   r   r   r   signX   s    zEd25519PrivateKey.signN)r   r   r   r   r"   r   r#   r   r   r   r$   r   r   ZPrivateFormatZKeySerializationEncryptionr&   r'   r   r   r   r   r!   .   s   r!   )r   Zcryptography.exceptionsr   r   Zcryptography.hazmat.primitivesr   Z_ED25519_KEY_SIZEZ_ED25519_SIG_SIZEABCMetar   r!   r   r   r   r   <module>   s   