Repository URL to install this package:
Version:
4.0.109 ▾
|
ó ۍEYc @` sÅ d d l m Z m Z m Z d d l Z d d l m Z d d l m Z d d l m Z m Z m Z d e j e e f d YZ d e j e e f d YZ d e j e e f d YZ d S( i ( t absolute_importt divisiont print_functionN( t encoding( t exceptions( t EncryptedMessaget StringFixert randomt PublicKeyc B` sM e Z d Z e j j Z e j d Z d Z d Z d Z d Z RS( s= The public key counterpart to an Curve25519 :class:`nacl.public.PrivateKey` for encrypting messages. :param public_key: [:class:`bytes`] Encoded Curve25519 public key :param encoder: A class that is able to decode the `public_key` :cvar SIZE: The size that the public key is required to be c C` sp | j | | _ t | j t s6 t j d n t | j | j k rl t j d j | j n d S( Ns' PublicKey must be created from 32 bytess- The public key must be exactly {0} bytes long( t decodet _public_keyt isinstancet bytest exct TypeErrort lent SIZEt ValueErrort format( t selft public_keyt encoder( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyt __init__$ s c C` s | j S( N( R ( R ( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyt __bytes__/ s c C` s t t | S( N( t hashR ( R ( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyt __hash__2 s c C` s5 t | | j s t St j j t | t | S( N( R t __class__t Falset naclt bindingst sodium_memcmpR ( R t other( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyt __eq__5 s c C` s | | k S( N( ( R R ( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyt __ne__: s ( t __name__t __module__t __doc__R R t crypto_box_PUBLICKEYBYTESR R t RawEncoderR R R R R! ( ( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyR s t PrivateKeyc B` s\ e Z d Z e j j Z e j d Z d Z d Z d Z d Z e d Z RS( s Private key for decrypting messages using the Curve25519 algorithm. .. warning:: This **must** be protected and remain secret. Anyone who knows the value of your :class:`~nacl.public.PrivateKey` can decrypt any message encrypted by the corresponding :class:`~nacl.public.PublicKey` :param private_key: The private key used to decrypt messages :param encoder: The encoder class used to decode the given keys :cvar SIZE: The size that the private key is required to be c C` s | j | } t | t s0 t j d n t | | j k r^ t j d | j n t j j | } | | _ t | | _ d S( Ns. PrivateKey must be created from a 32 byte seeds, The secret key must be exactly %d bytes long( R R R R R R R R R R t crypto_scalarmult_baset _private_keyR R ( R t private_keyR t raw_public_key( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyR O s c C` s | j S( N( R) ( R ( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyR ` s c C` s t t | S( N( R R ( R ( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyR c s c C` s5 t | | j s t St j j t | t | S( N( R R R R R R R ( R R ( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyR f s c C` s | | k S( N( ( R R ( ( s@ /home/tvault/.virtenv/lib/python2.7/site-packages/nacl/public.pyR! k s c C` s | t t j d t j S( s~ Generates a random :class:`~nacl.public.PrivateKey` object :rtype: :class:`~nacl.public.PrivateKey` R ( R R' R R R&