From 2e240e5072b41f48dbca1ca094d836aa1611bdec Mon Sep 17 00:00:00 2001 From: Pointcheval Hugo Date: Thu, 17 Dec 2020 22:09:00 +0100 Subject: [PATCH] Add some exceptions --- lib/src/exceptions.dart | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lib/src/exceptions.dart diff --git a/lib/src/exceptions.dart b/lib/src/exceptions.dart new file mode 100644 index 0000000..c9df2c9 --- /dev/null +++ b/lib/src/exceptions.dart @@ -0,0 +1,31 @@ +// Copyright (c) 2020 +// Author: Hugo Pointcheval + +class NativeCryptoException implements Exception { + String message; + NativeCryptoException(this.message); +} + +class KeyException extends NativeCryptoException { + KeyException(message) : super(message); +} + +class CipherInitException extends NativeCryptoException { + CipherInitException(message) : super(message); +} + +class KemInitException extends NativeCryptoException { + KemInitException(message) : super(message); +} + +class EncryptionException extends NativeCryptoException { + EncryptionException(message) : super(message); +} + +class DecryptionException extends NativeCryptoException { + DecryptionException(message) : super(message); +} + +class NotImplementedException extends NativeCryptoException { + NotImplementedException(message) : super(message); +}