License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | Stable |
Portability | Excellent |
Safe Haskell | Safe |
Language | Haskell2010 |
- data CryptoError
- = CryptoError_KeySizeInvalid
- | CryptoError_IvSizeInvalid
- | CryptoError_AEADModeNotSupported
- | CryptoError_SecretKeySizeInvalid
- | CryptoError_SecretKeyStructureInvalid
- | CryptoError_PublicKeySizeInvalid
- | CryptoError_SharedSecretSizeInvalid
- | CryptoError_EcScalarOutOfBounds
- | CryptoError_PointSizeInvalid
- | CryptoError_PointFormatInvalid
- | CryptoError_PointFormatUnsupported
- | CryptoError_PointCoordinatesInvalid
- | CryptoError_MacKeyInvalid
- | CryptoError_AuthenticationTagSizeInvalid
- data CryptoFailable a
- throwCryptoErrorIO :: CryptoFailable a -> IO a
- throwCryptoError :: CryptoFailable a -> a
- onCryptoFailure :: (CryptoError -> r) -> (a -> r) -> CryptoFailable a -> r
- eitherCryptoError :: CryptoFailable a -> Either CryptoError a
- maybeCryptoError :: CryptoFailable a -> Maybe a
Documentation
data CryptoError Source #
Enumeration of all possible errors that can be found in this library
data CryptoFailable a Source #
A simple Either like type to represent a computation that can fail
2 possibles values are:
CryptoPassed
: The computation succeeded, and contains the result of the computationCryptoFailed
: The computation failed, and contains the cryptographic error associated
Monad CryptoFailable Source # | |
Functor CryptoFailable Source # | |
Applicative CryptoFailable Source # | |
Eq a => Eq (CryptoFailable a) Source # | |
Show a => Show (CryptoFailable a) Source # | |
throwCryptoErrorIO :: CryptoFailable a -> IO a Source #
Throw an CryptoError as exception on CryptoFailed result, otherwise return the computed value
throwCryptoError :: CryptoFailable a -> a Source #
Same as throwCryptoErrorIO
but throw the error asynchronously.
onCryptoFailure :: (CryptoError -> r) -> (a -> r) -> CryptoFailable a -> r Source #
Simple either
like combinator for CryptoFailable type
eitherCryptoError :: CryptoFailable a -> Either CryptoError a Source #
Transform a CryptoFailable to an Either
maybeCryptoError :: CryptoFailable a -> Maybe a Source #
Transform a CryptoFailable to a Maybe