Package keyczar :: Module keyczar :: Class GenericKeyczar
[hide private]
[frames] | no frames]

Class GenericKeyczar

source code

object --+    
         |    
   Keyczar --+
             |
            GenericKeyczar

To be used by Keyczart.

Instance Methods [hide private]
 
IsAcceptablePurpose(self, purpose)
All purposes ok for Keyczart.
source code
 
AddVersion(self, status, size=None)
Adds a new key version with given status to key set.
source code
 
Promote(self, version_number)
Promotes the status of key with given version number.
source code
 
Demote(self, version_number)
Demotes the status of key with given version number.
source code
 
Revoke(self, version_number)
Revokes the key with given version number if scheduled to be revoked.
source code
 
PublicKeyExport(self, dest)
Export the public keys corresponding to our key set to destination.
source code
 
Write(self, loc, encrypter=None) source code

Inherited from Keyczar: GetKey, __init__, __str__

Inherited from Keyczar (private): _AddKey, _ParseHeader

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Static Methods [hide private]
Keyczar
Read(location)
Return a GenericKeyczar created from FileReader at given location.
source code
Properties [hide private]

Inherited from Keyczar: primary_key, versions

Inherited from object: __class__

Method Details [hide private]

Read(location)
Static Method

source code 

Return a GenericKeyczar created from FileReader at given location.

Parameters:
  • location - pathname of the directory storing the key files
Returns: Keyczar
a Keyczar to manage the keys stored at the given location
Overrides: Keyczar.Read

IsAcceptablePurpose(self, purpose)

source code 

All purposes ok for Keyczart.

Overrides: Keyczar.IsAcceptablePurpose

AddVersion(self, status, size=None)

source code 

Adds a new key version with given status to key set.

Generates a new key of same type (repeated until hash identifier is unique) for this version. Uses supplied key size (if provided) in lieu of the default key size. If this is an unacceptable key size, uses the default key size. Uses next available version number.

Parameters:
  • status (keyinfo.KeyStatus) - the status of the new key to be added
  • size (integer) - size of key in bits, uses default size if not provided.
Raises:

Promote(self, version_number)

source code 

Promotes the status of key with given version number.

Promoting ACTIVE key automatically demotes current PRIMARY key to ACTIVE.

Parameters:
  • version_number (integer) - the version number to promote
Raises:
  • KeyczarError - if invalid version number or trying to promote a primary key

Demote(self, version_number)

source code 

Demotes the status of key with given version number.

Demoting PRIMARY key results in a key set with no primary version.

Parameters:
  • version_number (integer) - the version number to demote
Raises:
  • KeyczarError - if invalid version number or trying to demote an inactive key, use Revoke instead.

Revoke(self, version_number)

source code 

Revokes the key with given version number if scheduled to be revoked.

Parameters:
  • version_number (integer) - integer version number to revoke
Raises:
  • KeyczarError - if invalid version number or key is not inactive.