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

Class KeyMetadata

source code

object --+
         |
        KeyMetadata

Encodes metadata for a keyset with a name, purpose, type, and versions.

Instance Methods [hide private]
 
__init__(self, name, purpose, type, encrypted=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
boolean
AddVersion(self, version)
Adds given version and returns True if successful.
source code
KeyVersion
RemoveVersion(self, version_number)
Removes version with given version number and returns it if it exists.
source code
KeyVersion
GetVersion(self, version_number)
Return the version corresponding to the given version number.
source code

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

Static Methods [hide private]
KeyMetadata
Read(json_string)
Return KeyMetadata object constructed from JSON string representation.
source code
Properties [hide private]
  versions

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, purpose, type, encrypted=False)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

AddVersion(self, version)

source code 

Adds given version and returns True if successful.

Parameters:
Returns: boolean
True if version was successfully added (i.e. no previous version had the same version number), False otherwise.

RemoveVersion(self, version_number)

source code 

Removes version with given version number and returns it if it exists.

Parameters:
  • version_number (integer) - version number to remove
Returns: KeyVersion
the removed version if it exists
Raises:

GetVersion(self, version_number)

source code 

Return the version corresponding to the given version number.

Parameters:
  • version_number (integer) - integer version number of desired version
Returns: KeyVersion
the corresponding version if it exists
Raises:

Read(json_string)
Static Method

source code 

Return KeyMetadata object constructed from JSON string representation.

Parameters:
  • json_string (string) - a JSON representation of a KeyMetadata object
Returns: KeyMetadata
the constructed KeyMetadata object

Property Details [hide private]

versions

Get Method:
unreachable(self)