jose-0.9: JSON Object Signing and Encryption (JOSE) and JSON Web Token (JWT) library
Safe HaskellNone
LanguageHaskell2010

Crypto.JOSE.Error

Description

JOSE error types.

Synopsis

Documentation

data Error Source #

All the errors that can occur.

Constructors

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

AnyValidated policy active, and no valid signature encountered

JWSInvalidSignature

AllValidated policy active, and invalid signature encountered

JWSNoSignatures

AllValidated policy active, and there were no signatures on object that matched the allowed algorithms

Instances

Instances details
Eq Error Source # 
Instance details

Defined in Crypto.JOSE.Error

Methods

(==) :: Error -> Error -> Bool

(/=) :: Error -> Error -> Bool

Show Error Source # 
Instance details

Defined in Crypto.JOSE.Error

Methods

showsPrec :: Int -> Error -> ShowS

show :: Error -> String

showList :: [Error] -> ShowS

AsError Error Source # 
Instance details

Defined in Crypto.JOSE.Error

class AsError r where Source #

Minimal complete definition

_Error

Methods

_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

Instances details
AsError Error Source # 
Instance details

Defined in Crypto.JOSE.Error

AsError JWTError Source # 
Instance details

Defined in Crypto.JWT

JOSE compact serialisation errors

data InvalidNumberOfParts Source #

The wrong number of parts were found when decoding a compact JOSE object.

Constructors

InvalidNumberOfParts Natural Natural

expected vs actual parts

Instances

Instances details
Eq InvalidNumberOfParts Source # 
Instance details

Defined in Crypto.JOSE.Error

Show InvalidNumberOfParts Source # 
Instance details

Defined in Crypto.JOSE.Error

Methods

showsPrec :: Int -> InvalidNumberOfParts -> ShowS

show :: InvalidNumberOfParts -> String

showList :: [InvalidNumberOfParts] -> ShowS

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

Constructors

CompactTextError Natural UnicodeException 

Instances

Instances details
Eq CompactTextError Source # 
Instance details

Defined in Crypto.JOSE.Error

Show CompactTextError Source # 
Instance details

Defined in Crypto.JOSE.Error

Methods

showsPrec :: Int -> CompactTextError -> ShowS

show :: CompactTextError -> String

showList :: [CompactTextError] -> ShowS

data CompactDecodeError Source #

An error when decoding a JOSE compact object. JSON decoding errors that occur during compact object processing throw JSONDecodeError.

Instances

Instances details
Eq CompactDecodeError Source # 
Instance details

Defined in Crypto.JOSE.Error

Show CompactDecodeError Source # 
Instance details

Defined in Crypto.JOSE.Error

Methods

showsPrec :: Int -> CompactDecodeError -> ShowS

show :: CompactDecodeError -> String

showList :: [CompactDecodeError] -> ShowS

Orphan instances

(MonadRandom m, MonadTrans t, Functor (t m), Monad (t m)) => MonadRandom (t m) Source # 
Instance details

Methods

getRandomBytes :: ByteArray byteArray => Int -> t m byteArray