Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
JOSE error types and helpers.
Synopsis
- runJOSE :: JOSE e m a -> m (Either e a)
- unwrapJOSE :: JOSE e m a -> ExceptT e m a
- newtype JOSE e m a = JOSE (ExceptT e m a)
- data Error
- = AlgorithmNotImplemented
- | AlgorithmMismatch String
- | KeyMismatch Text
- | KeySizeTooSmall
- | OtherPrimesNotSupported
- | RSAError Error
- | CryptoError CryptoError
- | CompactDecodeError CompactDecodeError
- | JSONDecodeError String
- | NoUsableKeys
- | JWSCritUnprotected
- | JWSNoValidSignatures
- | JWSInvalidSignature
- | JWSNoSignatures
- class AsError r where
- _Error :: Prism' r Error
- _AlgorithmNotImplemented :: Prism' r ()
- _AlgorithmMismatch :: Prism' r String
- _KeyMismatch :: Prism' r Text
- _KeySizeTooSmall :: Prism' r ()
- _OtherPrimesNotSupported :: Prism' r ()
- _RSAError :: Prism' r Error
- _CryptoError :: Prism' r CryptoError
- _CompactDecodeError :: Prism' r CompactDecodeError
- _JSONDecodeError :: Prism' r String
- _NoUsableKeys :: Prism' r ()
- _JWSCritUnprotected :: Prism' r ()
- _JWSNoValidSignatures :: Prism' r ()
- _JWSInvalidSignature :: Prism' r ()
- _JWSNoSignatures :: Prism' r ()
- data InvalidNumberOfParts = InvalidNumberOfParts Natural Natural
- expectedParts :: Getter InvalidNumberOfParts Natural
- actualParts :: Getter InvalidNumberOfParts Natural
- data CompactTextError = CompactTextError Natural UnicodeException
- data CompactDecodeError
- _CompactInvalidNumberOfParts :: Prism' CompactDecodeError InvalidNumberOfParts
- _CompactInvalidText :: Prism' CompactDecodeError CompactTextError
Running JOSE computations
unwrapJOSE :: JOSE e m a -> ExceptT e m a Source #
Instances
Monad m => MonadError e (JOSE e m) Source # | |
Defined in Crypto.JOSE.Error throwError :: e -> JOSE e m a # catchError :: JOSE e m a -> (e -> JOSE e m a) -> JOSE e m a # | |
MonadTrans (JOSE e) Source # | |
Defined in Crypto.JOSE.Error | |
MonadIO m => MonadIO (JOSE e m) Source # | |
Defined in Crypto.JOSE.Error | |
Monad m => Applicative (JOSE e m) Source # | |
Functor m => Functor (JOSE e m) Source # | |
Monad m => Monad (JOSE e m) Source # | |
MonadRandom m => MonadRandom (JOSE e m) Source # | |
Defined in Crypto.JOSE.Error getRandomBytes :: ByteArray byteArray => Int -> JOSE e m byteArray # |
Base error type and class
All the errors that can occur.
AlgorithmNotImplemented | A requested algorithm is not implemented |
AlgorithmMismatch String | A requested algorithm cannot be used |
KeyMismatch Text | Wrong type of key was given |
KeySizeTooSmall | Key size is too small |
OtherPrimesNotSupported | RSA private key with >2 primes not supported |
RSAError Error | RSA encryption, decryption or signing error |
CryptoError CryptoError | Various cryptonite library error cases |
CompactDecodeError CompactDecodeError | Wrong number of parts in compact serialisation |
JSONDecodeError String | JSON (Aeson) decoding error |
NoUsableKeys | No usable keys were found in the key store |
JWSCritUnprotected | |
JWSNoValidSignatures |
|
JWSInvalidSignature |
|
JWSNoSignatures |
|
Instances
Show Error Source # | |
Eq Error Source # | |
AsError Error Source # | |
Defined in Crypto.JOSE.Error _Error :: Prism' Error Error Source # _AlgorithmNotImplemented :: Prism' Error () Source # _AlgorithmMismatch :: Prism' Error String Source # _KeyMismatch :: Prism' Error Text Source # _KeySizeTooSmall :: Prism' Error () Source # _OtherPrimesNotSupported :: Prism' Error () Source # _RSAError :: Prism' Error Error0 Source # _CryptoError :: Prism' Error CryptoError Source # _CompactDecodeError :: Prism' Error CompactDecodeError Source # _JSONDecodeError :: Prism' Error String Source # _NoUsableKeys :: Prism' Error () Source # _JWSCritUnprotected :: Prism' Error () Source # _JWSNoValidSignatures :: Prism' Error () Source # _JWSInvalidSignature :: Prism' Error () Source # _JWSNoSignatures :: Prism' Error () Source # |
class AsError r where Source #
_Error :: Prism' r Error Source #
_AlgorithmNotImplemented :: Prism' r () Source #
_AlgorithmMismatch :: Prism' r String Source #
_KeyMismatch :: Prism' r Text Source #
_KeySizeTooSmall :: Prism' r () Source #
_OtherPrimesNotSupported :: Prism' r () Source #
_RSAError :: Prism' r Error Source #
_CryptoError :: Prism' r CryptoError Source #
_CompactDecodeError :: Prism' r CompactDecodeError Source #
_JSONDecodeError :: Prism' r String Source #
_NoUsableKeys :: Prism' r () Source #
_JWSCritUnprotected :: Prism' r () Source #
_JWSNoValidSignatures :: Prism' r () Source #
_JWSInvalidSignature :: Prism' r () Source #
_JWSNoSignatures :: Prism' r () Source #
Instances
JOSE compact serialisation errors
data InvalidNumberOfParts Source #
The wrong number of parts were found when decoding a compact JOSE object.
InvalidNumberOfParts Natural Natural | expected vs actual parts |
Instances
Show InvalidNumberOfParts Source # | |
Defined in Crypto.JOSE.Error showsPrec :: Int -> InvalidNumberOfParts -> ShowS # show :: InvalidNumberOfParts -> String # showList :: [InvalidNumberOfParts] -> ShowS # | |
Eq InvalidNumberOfParts Source # | |
Defined in Crypto.JOSE.Error (==) :: InvalidNumberOfParts -> InvalidNumberOfParts -> Bool # (/=) :: InvalidNumberOfParts -> InvalidNumberOfParts -> Bool # |
expectedParts :: Getter InvalidNumberOfParts Natural Source #
Get the expected or actual number of parts.
actualParts :: Getter InvalidNumberOfParts Natural Source #
Get the expected or actual number of parts.
data CompactTextError Source #
Bad UTF-8 data in a compact object, at the specified index
Instances
Show CompactTextError Source # | |
Defined in Crypto.JOSE.Error showsPrec :: Int -> CompactTextError -> ShowS # show :: CompactTextError -> String # showList :: [CompactTextError] -> ShowS # | |
Eq CompactTextError Source # | |
Defined in Crypto.JOSE.Error (==) :: CompactTextError -> CompactTextError -> Bool # (/=) :: CompactTextError -> CompactTextError -> Bool # |
data CompactDecodeError Source #
An error when decoding a JOSE compact object.
JSON decoding errors that occur during compact object processing
throw JSONDecodeError
.
Instances
Show CompactDecodeError Source # | |
Defined in Crypto.JOSE.Error showsPrec :: Int -> CompactDecodeError -> ShowS # show :: CompactDecodeError -> String # showList :: [CompactDecodeError] -> ShowS # | |
Eq CompactDecodeError Source # | |
Defined in Crypto.JOSE.Error (==) :: CompactDecodeError -> CompactDecodeError -> Bool # (/=) :: CompactDecodeError -> CompactDecodeError -> Bool # |