Your IP : 216.73.217.88


Current Path : /opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/__pycache__/keys.cpython-33.pyc

�
�/6R�c@sTdZddlZddlZddlmZmZmZGdd�de�Z	dS(uStore and retrieve wheel signing / verifying keys.

Given a scope (a package name, + meaning "all packages", or - meaning 
"no packages"), return a list of verifying keys that are trusted for that 
scope.

Given a package name, return a list of (scope, key) suggested keys to sign
that package (only the verifying keys; the private signing key is stored
elsewhere).

Keys here are represented as urlsafe_b64encoded strings with no padding.

Tentative command line interface:

# list trusts
wheel trust
# trust a particular key for all
wheel trust + key
# trust key for beaglevote
wheel trust beaglevote key
# stop trusting a key for all
wheel untrust + key

# generate a key pair
wheel keygen

# import a signing key from a file
wheel import keyfile

# export a signing key
wheel export key
iN(unativeuload_config_pathsusave_config_pathcBs�|EeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	dd
d�Zdd�Zdd�Z
dS(u	WheelKeysiu
wheel.jsoncCsigd6gd6|_dS(Nusignersu	verifiers(udata(uself((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyu__init__*suWheelKeys.__init__cCsx�td�D]�}tjjt|�|j�}tjj|�r
t|d���}tj	|�|_
x-dD]%}||j
krng|j
|<qnqnWd|j
kr�|j|j
d<n;|j
d|jkr�tdj
|j
d|j���nWdQXPq
q
W|S(Nuwheelurusignersu	verifiersuschemau(Bad wheel.json version {0}, expected {1}(usignersu	verifiers(uload_config_pathsuosupathujoinunativeuCONFIG_NAMEuexistsuopenujsonuloadudatauSCHEMAu
ValueErroruformat(uselfupathuconfuinfileux((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyuload-s 
"uWheelKeys.loadcCs_td�}tjjt|�|j�}t|d�� }tj|j	|dd�WdQX|S(Nuwheeluw+uindenti(
usave_config_pathuosupathujoinunativeuCONFIG_NAMEuopenujsonudumpudata(uselfupathuconfuout((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyusave@s
uWheelKeys.savecCs&|jdji|d6|d6�|S(u0Start trusting a particular key for given scope.u	verifiersuscopeuvk(udatauappend(uselfuscopeuvk((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyutrustHs"uWheelKeys.trustcCs&|jdji|d6|d6�|S(u/Stop trusting a particular key for given scope.u	verifiersuscopeuvk(udatauremove(uselfuscopeuvk((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyuuntrustMs"uWheelKeys.untrustcsD�fdd�|jdD�}|jddd��|j�|S(u;Return list of [(scope, trusted key), ...] for given scope.cs:g|]0}|d�dfkr|d|df�qS(uscopeu+uvk((u.0ux(uscope(uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyu
<listcomp>Ts	u%WheelKeys.trusted.<locals>.<listcomp>u	verifiersukeycSs|dS(Ni((ux((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyu<lambda>Usu#WheelKeys.trusted.<locals>.<lambda>(udatausortureverse(uselfuscopeutrust((uscopeuF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyutrustedRs 
uWheelKeys.trustedcsD�fdd�|jdD�}|jddd��|j�|S(uReturn list of signing key(s).cs:g|]0}|d�dfkr|d|df�qS(uscopeu+uvk((u.0ux(uscope(uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyu
<listcomp>[s	u%WheelKeys.signers.<locals>.<listcomp>usignersukeycSs|dS(Ni((ux((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyu<lambda>\su#WheelKeys.signers.<locals>.<lambda>(udatausortureverse(uselfuscopeusign((uscopeuF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyusignersYs 
uWheelKeys.signerscCs&|jdji|d6|d6�dS(u>Remember verifying key vk as being valid for signing in scope.usignersuscopeuvkN(udatauappend(uselfuscopeuvk((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyu
add_signer`suWheelKeys.add_signerN(u__name__u
__module__u__qualname__uSCHEMAuCONFIG_NAMEu__init__uloadusaveutrustuuntrustuNoneutrustedusignersu
add_signer(u
__locals__((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyu	WheelKeys&su	WheelKeys(
u__doc__ujsonuos.pathuosu
wheel.utilunativeuload_config_pathsusave_config_pathuobjectu	WheelKeys(((uF/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/keys.pyu<module> s