| License | BSD-style | 
|---|---|
| Maintainer | Vincent Hanquez <[email protected]> | 
| Stability | Stable | 
| Portability | Excellent | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
Crypto.Error
Description
Synopsis
- data CryptoError
- = CryptoError_KeySizeInvalid
 - | CryptoError_IvSizeInvalid
 - | CryptoError_SeedSizeInvalid
 - | CryptoError_AEADModeNotSupported
 - | CryptoError_SecretKeySizeInvalid
 - | CryptoError_SecretKeyStructureInvalid
 - | CryptoError_PublicKeySizeInvalid
 - | CryptoError_SharedSecretSizeInvalid
 - | CryptoError_EcScalarOutOfBounds
 - | CryptoError_PointSizeInvalid
 - | CryptoError_PointFormatInvalid
 - | CryptoError_PointFormatUnsupported
 - | CryptoError_PointCoordinatesInvalid
 - | CryptoError_ScalarMultiplicationInvalid
 - | CryptoError_MacKeyInvalid
 - | CryptoError_AuthenticationTagSizeInvalid
 - | CryptoError_PrimeSizeInvalid
 - | CryptoError_SaltTooSmall
 - | CryptoError_OutputLengthTooSmall
 - | CryptoError_OutputLengthTooBig
 
 - 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
Constructors
Instances
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
Constructors
| CryptoPassed a | |
| CryptoFailed CryptoError | 
Instances
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