Package keyczar :: Module keyinfo
[hide private]
[frames] | no frames]

Module keyinfo

source code

Defines several 'enums' encoding information about keys, such as type, status, purpose, and the cipher mode.


Author: arkajit.dey@gmail.com (Arkajit Dey)

Classes [hide private]
  _NameId
  KeyType
Encodes different key types and their properties:
  KeyStatus
Encodes the different possible statuses of a key:
  KeyPurpose
Encodes the different possible purposes for which a key can be used:
  CipherMode
Encodes the different possible modes for a cipher:
Functions [hide private]
 
GetType(name) source code
 
GetStatus(value) source code
 
GetPurpose(name) source code
 
GetMode(name) source code
Variables [hide private]
  AES = KeyType("AES", 0, [128, 192, 256], 0)
  HMAC_SHA1 = KeyType("HMAC_SHA1", 1, [256], 20)
  DSA_PRIV = KeyType("DSA_PRIV", 2, [1024], 48)
  DSA_PUB = KeyType("DSA_PUB", 3, [1024], 48)
  RSA_PRIV = KeyType("RSA_PRIV", 4, [2048, 1024, 768, 512], 256)
  RSA_PUB = KeyType("RSA_PUB", 4, [2048, 1024, 768, 512], 256)
  types = {"AES": AES, "HMAC_SHA1": HMAC_SHA1, "DSA_PRIV": DSA_P...
  PRIMARY = KeyStatus("PRIMARY", 0)
  ACTIVE = KeyStatus("ACTIVE", 1)
  INACTIVE = KeyStatus("INACTIVE", 2)
  statuses = {"PRIMARY": PRIMARY, "ACTIVE": ACTIVE, "INACTIVE": ...
  DECRYPT_AND_ENCRYPT = KeyPurpose("DECRYPT_AND_ENCRYPT", 0)
  ENCRYPT = KeyPurpose("ENCRYPT", 1)
  SIGN_AND_VERIFY = KeyPurpose("SIGN_AND_VERIFY", 2)
  VERIFY = KeyPurpose("VERIFY", 3)
  purposes = {"DECRYPT_AND_ENCRYPT": DECRYPT_AND_ENCRYPT, "ENCRY...
  CBC = CipherMode("CBC", 0, True, lambda b, i:(i/ b+ 2)* b)
  CTR = CipherMode("CTR", 1, True, lambda b, i: i+ b/ 2)
  ECB = CipherMode("ECB", 2, False, lambda b, i: b)
  DET_CBC = CipherMode("DET_CBC", 3, False, lambda b, i:(i/ b+ 1...
  modes = {"CBC": CBC, "CTR": CTR, "ECB": ECB, "DET_CBC": DET_CBC}
Variables Details [hide private]

types

Value:
{"AES": AES, "HMAC_SHA1": HMAC_SHA1, "DSA_PRIV": DSA_PRIV, "DSA_PUB": \
DSA_PUB, "RSA_PRIV": RSA_PRIV, "RSA_PUB": RSA_PUB}

statuses

Value:
{"PRIMARY": PRIMARY, "ACTIVE": ACTIVE, "INACTIVE": INACTIVE}

purposes

Value:
{"DECRYPT_AND_ENCRYPT": DECRYPT_AND_ENCRYPT, "ENCRYPT": ENCRYPT, "SIGN\
_AND_VERIFY": SIGN_AND_VERIFY, "VERIFY": VERIFY}

DET_CBC

Value:
CipherMode("DET_CBC", 3, False, lambda b, i:(i/ b+ 1)* b)