diff options
Diffstat (limited to 'src/leap/common/keymanager/keys.py')
-rw-r--r-- | src/leap/common/keymanager/keys.py | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/src/leap/common/keymanager/keys.py b/src/leap/common/keymanager/keys.py index be1f113..a3c8537 100644 --- a/src/leap/common/keymanager/keys.py +++ b/src/leap/common/keymanager/keys.py @@ -84,10 +84,10 @@ def is_address(address): """ Return whether the given C{address} is in the form user@provider. - @param address: The address to be tested. - @type address: str - @return: Whether C{address} is in the form user@provider. - @rtype: bool + :param address: The address to be tested. + :type address: str + :return: Whether C{address} is in the form user@provider. + :rtype: bool """ return bool(re.match('[\w.-]+@[\w.-]+', address)) @@ -96,12 +96,12 @@ def build_key_from_dict(kClass, address, kdict): """ Build an C{kClass} key bound to C{address} based on info in C{kdict}. - @param address: The address bound to the key. - @type address: str - @param kdict: Dictionary with key data. - @type kdict: dict - @return: An instance of the key. - @rtype: C{kClass} + :param address: The address bound to the key. + :type address: str + :param kdict: Dictionary with key data. + :type kdict: dict + :return: An instance of the key. + :rtype: C{kClass} """ leap_assert( address == kdict[KEY_ADDRESS_KEY], @@ -119,7 +119,6 @@ def build_key_from_dict(kClass, address, kdict): validation=kdict[KEY_VALIDATION_KEY], # TODO: verify for validation. ) - # # Abstraction for encryption keys # @@ -161,8 +160,8 @@ class EncryptionKey(object): """ Return a JSON string describing this key. - @return: The JSON string describing this key. - @rtype: str + :return: The JSON string describing this key. + :rtype: str """ return json.dumps({ KEY_ADDRESS_KEY: self.address, @@ -209,8 +208,8 @@ class EncryptionScheme(object): """ Initialize this Encryption Scheme. - @param soledad: A Soledad instance for local storage of keys. - @type soledad: leap.soledad.Soledad + :param soledad: A Soledad instance for local storage of keys. + :type soledad: leap.soledad.Soledad """ self._soledad = soledad self._init_indexes() @@ -240,13 +239,13 @@ class EncryptionScheme(object): """ Get key from local storage. - @param address: The address bound to the key. - @type address: str - @param private: Look for a private key instead of a public one? - @type private: bool + :param address: The address bound to the key. + :type address: str + :param private: Look for a private key instead of a public one? + :type private: bool - @return: The key bound to C{address}. - @rtype: EncryptionKey + :return: The key bound to C{address}. + :rtype: EncryptionKey @raise KeyNotFound: If the key was not found on local storage. """ pass @@ -256,8 +255,8 @@ class EncryptionScheme(object): """ Put a key in local storage. - @param key: The key to be stored. - @type key: EncryptionKey + :param key: The key to be stored. + :type key: EncryptionKey """ pass @@ -266,11 +265,11 @@ class EncryptionScheme(object): """ Generate a new key. - @param address: The address bound to the key. - @type address: str + :param address: The address bound to the key. + :type address: str - @return: The key bound to C{address}. - @rtype: EncryptionKey + :return: The key bound to C{address}. + :rtype: EncryptionKey """ pass @@ -279,7 +278,7 @@ class EncryptionScheme(object): """ Remove C{key} from storage. - @param key: The key to be removed. - @type key: EncryptionKey + :param key: The key to be removed. + :type key: EncryptionKey """ pass |