diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2017-02-15 15:40:30 -0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-12-03 20:43:35 +0100 |
commit | d80b8774914dd21b9d61ecd4b3c3f3fe66e1c182 (patch) | |
tree | aaa574bc61cbe0d940608fe086d2404a5306d062 /src/leap/bitmask/keymanager/__init__.py | |
parent | 0db384bbe7697d320dfc00f1976de1ca16636d27 (diff) |
[refactor] rename key extension to expiration
This changes reflect python-gnupg naming.
With @aarni
Diffstat (limited to 'src/leap/bitmask/keymanager/__init__.py')
-rw-r--r-- | src/leap/bitmask/keymanager/__init__.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/leap/bitmask/keymanager/__init__.py b/src/leap/bitmask/keymanager/__init__.py index 09ac9bc7..9240b8a5 100644 --- a/src/leap/bitmask/keymanager/__init__.py +++ b/src/leap/bitmask/keymanager/__init__.py @@ -787,23 +787,25 @@ class KeyManager(object): yield self.put_key(pubkey) @defer.inlineCallbacks - def extend_key_expiration(self, validity='1y', passphrase=None): + def change_key_expiration(self, expiration_time='1y', passphrase=None): """ - extend the expiration date of the key pair bound to the user's address - by the validity period, from the key's creation date. + Change the expiration date of the key pair bound to the user's address + by the expiration_time period, from the current day. - :param validity: new validity from creation date 'n','nw','nm' or 'ny' - where n is a number - :type validity: str + :param expiration_time: new expiration time from current day in 'n', + 'nw', 'nm' or 'ny' where n is a number + :type expiration_time: str :return: The updated secret key, with new expiry date :rtype: OpenPGPKey - :raise KeyExpiryExtensionError: if invalid validity period + :raise KeyExpirationError: if invalid expiration time period """ my_secret_key = yield self.get_key(self._address, private=True) - renewed_key = yield self._openpgp.extend_key(my_secret_key, validity, - passphrase) + renewed_key = yield self._openpgp.expire( + my_secret_key, + expiration_time=expiration_time, + passphrase=passphrase) yield self._openpgp.reset_all_keys_sign_used() defer.returnValue(renewed_key) |