diff options
Diffstat (limited to 'common/src/leap/soledad/common/crypto.py')
-rw-r--r-- | common/src/leap/soledad/common/crypto.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/common/src/leap/soledad/common/crypto.py b/common/src/leap/soledad/common/crypto.py index 56bb608a..b4f3234f 100644 --- a/common/src/leap/soledad/common/crypto.py +++ b/common/src/leap/soledad/common/crypto.py @@ -35,13 +35,29 @@ class EncryptionSchemes(object): PUBKEY = 'pubkey' -class UnknownEncryptionScheme(Exception): +class UnknownEncryptionSchemeError(Exception): """ Raised when trying to decrypt from unknown encryption schemes. """ pass +class EncryptionMethods(object): + """ + Representation of encryption methods that can be used. + """ + + AES_256_CTR = 'aes-256-ctr' + XSALSA20 = 'xsalsa20' + + +class UnknownEncryptionMethodError(Exception): + """ + Raised when trying to encrypt/decrypt with unknown method. + """ + pass + + class MacMethods(object): """ Representation of MAC methods used to authenticate document's contents. @@ -50,7 +66,7 @@ class MacMethods(object): HMAC = 'hmac' -class UnknownMacMethod(Exception): +class UnknownMacMethodError(Exception): """ Raised when trying to authenticate document's content with unknown MAC mehtod. @@ -58,7 +74,7 @@ class UnknownMacMethod(Exception): pass -class WrongMac(Exception): +class WrongMacError(Exception): """ Raised when failing to authenticate document's contents based on MAC. """ |