feat: Add a untest decrypt function

This commit is contained in:
2022-08-04 14:01:50 +02:00
parent e34e0cc7fb
commit 4d6dbef549
4 changed files with 89 additions and 1 deletions

View File

@@ -3,7 +3,8 @@ class InvalidSignatureException implements Exception {
String errMsg() => 'The signature of the SPK does not match the provided signature';
}
/// Triggered by the Double Ratchet if the computet HMAC does not match the attached HMAC.
/// Triggered by the Double Ratchet if the computed HMAC does not match the attached HMAC.
/// Triggered by the Session Manager if the computed HMAC does not match the attached HMAC.
class InvalidMessageHMACException implements Exception {
String errMsg() => 'The computed HMAC does not match the provided HMAC';
}
@@ -13,3 +14,13 @@ class InvalidMessageHMACException implements Exception {
class SkippingTooManyMessagesException implements Exception {
String errMsg() => 'Skipping messages would cause a skip bigger than MAXSKIP';
}
/// Triggered by the Session Manager if the message key is not encrypted for the device.
class NotEncryptedForDeviceException implements Exception {
String errMsg() => 'Not encrypted for this device';
}
/// Triggered by the Session Manager when there is no key for decrypting the message.
class NoDecryptionKeyException implements Exception {
String errMsg() => 'No key available for decrypting the message';
}