diff options
author | drebs <drebs@leap.se> | 2013-05-09 17:53:07 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-05-11 17:17:46 -0300 |
commit | 23e435cf12b9bdd25410b3b8a48ced4168f872d2 (patch) | |
tree | 2b7af930e7593c8315d24eef44de4d53dbd2b70a /src/leap/common/keymanager/errors.py | |
parent | 8fae83a20504851845eeda5c089f2c53f8678eae (diff) |
Encrypt/decrypt can also sign/verify.
Also Implement code review comments for openpgp sign.
* Add assertions and exceptions to openpgp encrypt/decrypt/sign/verify methods.
* Added comments where they will help.
* Make code more clear by encapsulating more the access to GPG wrapper and
removing concatenation of ascii armored keys.
* Add verification of fingerprint of verifying key.
* Shorten check for signing key id.
Diffstat (limited to 'src/leap/common/keymanager/errors.py')
-rw-r--r-- | src/leap/common/keymanager/errors.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/leap/common/keymanager/errors.py b/src/leap/common/keymanager/errors.py index 1cf506e..f712975 100644 --- a/src/leap/common/keymanager/errors.py +++ b/src/leap/common/keymanager/errors.py @@ -25,12 +25,14 @@ class KeyNotFound(Exception): """ Raised when key was no found on keyserver. """ + pass class KeyAlreadyExists(Exception): """ Raised when attempted to create a key that already exists. """ + pass class KeyAttributesDiffer(Exception): @@ -38,9 +40,35 @@ class KeyAttributesDiffer(Exception): Raised when trying to delete a key but the stored key differs from the key passed to the delete_key() method. """ + pass class NoPasswordGiven(Exception): """ Raised when trying to perform some action that needs a password without providing one. """ + pass + +class InvalidSignature(Exception): + """ + Raised when signature could not be verified. + """ + pass + +class EncryptionFailed(Exception): + """ + Raised upon failures of encryption. + """ + pass + +class DecryptionFailed(Exception): + """ + Raised upon failures of decryption. + """ + pass + +class SignFailed(Exception): + """ + Raised when failed to sign. + """ + pass |