%PDF- %PDF-
| Direktori : /proc/self/root/proc/thread-self/root/lib64/python2.7/site-packages/zmq/auth/ |
| Current File : //proc/self/root/proc/thread-self/root/lib64/python2.7/site-packages/zmq/auth/certs.pyo |
�
+�{Wc @ s� d Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z m Z m Z m
Z
e
d � Z e
d � Z d d d d � Z d d � Z d � Z d
d � Z d d
d g Z d S( s1 0MQ authentication related functions and classes.i����N( t bytest unicodet bt us� # **** 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.
s utf-8c C st t | t � r! | j | � } n t | t � rB | j | � } n t j | d d d ��} | j | j t j j � � � | j t d � � | rx~ | j
� D]m \ } } t | t � r� | j | � } n t | t � r� | j | � } n | j t d � j | | � � q� Wn | j t d � � | j t d � j | � � | rj| j t d � j | � � n Wd QXd S(
s Create a certificate filet wt encodingt utf8s metadata
s {0} = {1}
s curve
s public-key = "{0}"
s secret-key = "{0}"
N( t
isinstanceR t decodet iot opent writet formatt datetimet nowR t items( t key_filenamet bannert
public_keyt
secret_keyt metadataR t ft kt v( ( s4 /usr/lib64/python2.7/site-packages/zmq/auth/certs.pyt _write_key_file s$ &c C s� t j � \ } } t j j | | � } d j | � } d j | � } t j j � } t | t j | � | � t | t
j | � | d | d | �| | f S( si Create zmq certificates.
Returns the file paths to the public and secret certificate files.
s {0}.key_secrets {0}.keyR R ( t zmqt
curve_keypairt ost patht joinR R
R R t _cert_public_bannert _cert_secret_banner( t key_dirt nameR R R t
base_filenamet secret_key_filet public_key_fileR ( ( s4 /usr/lib64/python2.7/site-packages/zmq/auth/certs.pyt create_certificates6 s c C s d } d } t j j | � s6 t d j | � � � n t | d � �� } x� | D]� } | j � } | j d � rv qO n | j d � r� | j d d � d j d � } n | j d � r� | j d d � d j d � } n | rO | rO PqO qO WWd QX| d k rt
d
| � � n | | f S( s Load 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.
s Invalid certificate file: {0}t rbt #s
public-keyt =i s '"s
secret-keyNs No public key found in %s( t NoneR R t existst IOErrorR R
t stript
startswitht splitt
ValueError( t filenameR R R t line( ( s4 /usr/lib64/python2.7/site-packages/zmq/auth/certs.pyt load_certificateN s$
""t .c C s� i } t j j | � s0 t d j | � � � n t j j | d � } t j | � } x3 | D]+ } t | � \ } } | r[ t | | <q[ q[ W| S( s5 Load public keys from all certificates in a directorys"