HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/thread-self/root/lib64/python3.6/site-packages/zmq/auth/__pycache__/certs.cpython-36.pyc
3

VS�_S�@s�dZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
e
d�Ze
d�Zddd�Z
dd	d
�Zdd�Zddd�Zd
ddgZdS)z10MQ authentication related functions and classes.�N)�bytes�unicode�b�uz�#   ****  Generated on {0} by pyzmq  ****
#   ZeroMQ CURVE **Secret** Certificate
#   DO NOT PROVIDE THIS FILE TO OTHER USERS nor change its permissions.

a
#   ****  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.

�utf-8c	Cs�t|t�r|j|�}t|t�r(|j|�}tj|ddd���}|j|jtjj���|jt	d��|r�xR|j
�D]F\}}t|t�r�|j|�}t|t�r�|j|�}|jt	d�j||��qlW|jt	d��|jt	d�j|��|r�|jt	d�j|��Wd	QRXd	S)
zCreate a certificate file�w�utf8)�encodingz	metadata
z    {0} = {1}
zcurve
z    public-key = "{0}"
z    secret-key = "{0}"
N)�
isinstancer�decode�io�open�write�format�datetime�nowr�items)	Zkey_filenameZbanner�
public_key�
secret_key�metadatar	�f�k�v�r�/usr/lib64/python3.6/certs.py�_write_key_files$







rc	Csjtj�\}}tjj||�}dj|�}dj|�}tjj�}t|t	j|�|�t|t
j|�|||d�||fS)ziCreate zmq certificates.
    
    Returns the file paths to the public and secret certificate files.
    z{0}.key_secretz{0}.key)rr)�zmqZ
curve_keypair�os�path�joinrrrr�_cert_public_banner�_cert_secret_banner)	Zkey_dir�namerrr�
base_filenameZsecret_key_fileZpublic_key_filerrrr�create_certificates6s


r$cCs�d}d}tjj|�s"tdj|���t|d��r}xj|D]b}|j�}|jd�rLq4|jd�rl|jdd�djd�}|jd	�r�|jdd�djd�}|r4|r4Pq4WWdQRX|dkr�t	d
|��||fS)aLoad 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.
    NzInvalid certificate file: {0}�rb�#s
public-key�=�s 	'"s
secret-keyzNo public key found in %s)
rr�exists�IOErrorrr
�strip�
startswith�split�
ValueError)�filenamerrr�linerrr�load_certificateNs$




r1�.cCs`i}tjj|�stdj|���tjj|d�}tj|�}x$|D]}t|�\}}|r<d||<q<W|S)z5Load public keys from all certificates in a directoryz"Invalid certificate directory: {0}z*.keyT)rr�isdirr*rr�globr1)Z	directoryZcertsZglob_stringZ
cert_filesZ	cert_filer�_rrr�load_certificatesos

r6)NNr)N)r2)�__doc__rr4rrrZzmq.utils.strtypesrrrrr!r rr$r1r6�__all__rrrr�<module>s

!