NPc@sdZddlZdefdYZdefdYZeddd d d gdZed d d gdZedddgdZedddgdZedddddddgd Z edddddddgd Z ied6ed 6ed6ed6e d6e d6Z dZ defdYZ e ddZe d d Ze d!dZied6ed 6ed!6Zd"Zd#efd$YZed%dZed&d Zed'dZed(dZied%6ed&6ed'6ed(6Zd)Zd*efd+YZed,ded-Zed.d ed/Zed0ded1Zed2ded3Z ied,6ed.6ed06e d26Z!d4Z"dS(5s Defines several 'enums' encoding information about keys, such as type, status, purpose, and the cipher mode. @author: arkajit.dey@gmail.com (Arkajit Dey) iNt_NameIdcBseZdZdZRS(cCs||_||_dS(N(tnametid(tselfRtkey_id((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyt__init__s cCs|jS(N(R(R((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyt__str__s(t__name__t __module__RR(((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyRs tKeyTypecBs5eZdZedddZdZdZRS(s Encodes different key types and their properties: - AES - HMAC-SHA1 - DSA Private - DSA Public - RSA Private - RSA Public cCs|jS(N(t_KeyType__sizes(R((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyt,stdocs*List of valid key sizes for this key type.cCs9tj|||||_||_|jd|_dS(Ni(RRR t output_sizet default_size(RRRtsizesR ((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyR0s  cCs ||jkS(N(R (Rtsize((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyt IsValidSize6s(RRt__doc__tpropertyRRR(((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyR !s     tAESiiiit HMAC_SHA1iitDSA_PRIViii0tDSA_PUBitRSA_PRIViiiiitRSA_PUBcCs3y t|SWn tk r.tjdnXdS(NsInvalid Key Type(ttypestKeyErrorterrorst KeyczarError(R((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pytGetTypeBs  t KeyStatuscBseZdZRS(s Encodes the different possible statuses of a key: - Primary: can be used to encrypt and sign new data - Active: can be used to decrypt or verify data signed previously - Inactive: can do the same functions as an active key, but about to be revoked (RRR(((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyRHstPRIMARYtACTIVEtINACTIVEcCs3y t|SWn tk r.tjdnXdS(NsInvalid Key Status(tstatusesRRR(tvalue((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyt GetStatusVs  t KeyPurposecBseZdZRS(s Encodes the different possible purposes for which a key can be used: - Decrypt and Encrypt - Encrypt (only) - Sign and Verify - Verify (only) (RRR(((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyR&\stDECRYPT_AND_ENCRYPTtENCRYPTtSIGN_AND_VERIFYtVERIFYcCs3y t|SWn tk r.tjdnXdS(NsInvalid Key Purpose(tpurposesRRR(R((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyt GetPurposels  t CipherModecBseZdZdZRS(s Encodes the different possible modes for a cipher: - Cipher Block Chaining (CBC) - Counter (CTR) - Electronic Code Book (ECB) - Cipher Block Chaining without IV (DET-CBC) cCs)tj|||||_||_dS(N(RRtuse_ivt GetOutputSize(RRRR.t OutputSizeFn((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyR{s (RRRR(((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyR-rstCBCcCs||d|S(Ni((tbti((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyR stCTRcCs ||dS(Ni((R2R3((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyR stECBcCs|S(N((R2R3((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyR stDET_CBCcCs||d|S(Ni((R2R3((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pyR scCs3y t|SWn tk r.tjdnXdS(NsInvalid Cipher Mode(tmodesRRR(R((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pytGetModes  (#RRtobjectRR RRRRRRRRRR R!R"R#R%R&R'R(R)R*R+R,R-tTrueR1R4tFalseR5R6R7R8(((s3/usr/lib/python2.7/site-packages/keyczar/keyinfo.pytsB $$     "