paseto-0.1.1.1: Platform-Agnostic Security Tokens
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crypto.Paseto.Token.Encoding

Description

PASETO token encoding and decoding in accordance with the message format defined in the specification.

Synopsis

Encoding

encode :: Token v p -> Text Source #

Encode a PASETO token as human-readable text according to the message format defined in the specification.

encodeSomeToken :: SomeToken -> Text Source #

Encode a PASETO token as human-readable text according to the message format defined in the specification.

Decoding

data CommonDecodingError Source #

Common error decoding a PASETO token.

Constructors

CommonDecodingParseError !ParseError

Error parsing the token.

CommonDecodingClaimsValidationError !(NonEmpty ValidationError)

Token claims validation error.

decodeTokenV3Local Source #

Arguments

:: SymmetricKey V3

Symmetric key.

-> [ValidationRule]

Validation rules.

-> Maybe Footer

Optional footer to authenticate.

-> Maybe ImplicitAssertion

Optional implicit assertion to authenticate.

-> Text

Encoded PASETO token.

-> Either V3LocalDecodingError (ValidatedToken V3 Local) 

Parse, decrypt, and validate a version 3 local PASETO token.

data V3PublicDecodingError Source #

Error decoding a version 3 public PASETO token.

Constructors

V3PublicDecodingCommonError !CommonDecodingError

Common decoding error.

V3PublicDecodingVerificationError !VerificationError

Cryptographic signature verification error.

decodeTokenV3Public Source #

Arguments

:: VerificationKey V3

Verification key.

-> [ValidationRule]

Validation rules.

-> Maybe Footer

Optional footer to authenticate.

-> Maybe ImplicitAssertion

Optional implicit assertion to authenticate.

-> Text

Encoded PASETO token.

-> Either V3PublicDecodingError (ValidatedToken V3 Public) 

Parse, verify, and validate a version 3 public PASETO token.

decodeTokenV4Local Source #

Arguments

:: SymmetricKey V4

Symmetric key.

-> [ValidationRule]

Validation rules.

-> Maybe Footer

Optional footer to authenticate.

-> Maybe ImplicitAssertion

Optional implicit assertion to authenticate.

-> Text

Encoded PASETO token.

-> Either V4LocalDecodingError (ValidatedToken V4 Local) 

Parse, decrypt, and validate a version 4 local PASETO token.

data V4PublicDecodingError Source #

Error decoding a version 4 public PASETO token.

Constructors

V4PublicDecodingCommonError !CommonDecodingError

Common decoding error.

V4PublicDecodingVerificationError !VerificationError

Cryptographic signature verification error.

decodeTokenV4Public Source #

Arguments

:: VerificationKey V4

Verification key.

-> [ValidationRule]

Validation rules.

-> Maybe Footer

Optional footer to authenticate.

-> Maybe ImplicitAssertion

Optional implicit assertion to authenticate.

-> Text

Encoded PASETO token.

-> Either V4PublicDecodingError (ValidatedToken V4 Public) 

Parse, verify, and validate a version 4 public PASETO token.

Validated token

data ValidatedToken v p Source #

PASETO token which has been decoded and validated.

Constructors

ValidatedToken 

Fields

Instances

Instances details
Show (ValidatedToken v p) Source # 
Instance details

Defined in Crypto.Paseto.Token.Encoding

Eq (ValidatedToken v p) Source # 
Instance details

Defined in Crypto.Paseto.Token.Encoding