jose-0.1.26.0: Javascript Object Signing and Encryption

Safe HaskellNone

Crypto.JOSE.JWS

Description

JSON Web Signature (JWS) represents content secured with digital signatures or Message Authentication Codes (MACs) using JavaScript Object Notation (JSON) based data structures.

Synopsis

Documentation

data Header Source

JWS Header data type.

Constructors

Header 

Fields

headerAlg :: Alg
 
headerJku :: Maybe URI

JWK Set URL

headerJwk :: Maybe JWK
 
headerKid :: Maybe String

interpretation unspecified

headerX5u :: Maybe URI
 
headerX5t :: Maybe Base64SHA1
 
headerX5c :: Maybe [Base64X509]

TODO implement min len of 1

headerTyp :: Maybe String

Content Type (of object)

headerCty :: Maybe String

Content Type (of payload)

headerCrit :: Maybe CritParameters
 
headerRaw :: Maybe ByteString

protected header, if known

data JWS Source

JSON Web Signature data type. Consists of a payload and a (possibly empty) list of signatures.

Constructors

JWS Base64Octets [Signature] 

jwsPayload :: JWS -> ByteStringSource

Payload of a JWS, as a lazy bytestring.

signJWSSource

Arguments

:: JWS

JWS to sign

-> Header

Header for signature

-> JWK

Key with which to sign

-> JWS

JWS with new signature appended

Create a new signature on a JWS.

verifyJWS :: JWK -> JWS -> BoolSource

Verify a JWS.

Verification succeeds if any signature on the JWS is successfully validated with the given Key.