| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Crypto.JWT
Description
JSON Web Token implementation.
- data JWT = JWT {
- jwtCrypto :: JWTCrypto
- jwtClaimsSet :: ClaimsSet
- claimAud :: Lens' ClaimsSet (Maybe Audience)
- claimExp :: Lens' ClaimsSet (Maybe NumericDate)
- claimIat :: Lens' ClaimsSet (Maybe NumericDate)
- claimIss :: Lens' ClaimsSet (Maybe StringOrURI)
- claimJti :: Lens' ClaimsSet (Maybe Text)
- claimNbf :: Lens' ClaimsSet (Maybe NumericDate)
- claimSub :: Lens' ClaimsSet (Maybe StringOrURI)
- unregisteredClaims :: Lens' ClaimsSet (HashMap Text Value)
- addClaim :: Text -> Value -> ClaimsSet -> ClaimsSet
- createJWSJWT :: MonadRandom m => JWK -> JWSHeader -> ClaimsSet -> m (Either Error JWT)
- validateJWSJWT :: ValidationAlgorithms -> ValidationPolicy -> JWK -> JWT -> Bool
- data ClaimsSet = ClaimsSet {}
- emptyClaimsSet :: ClaimsSet
- data Audience
- data StringOrURI
- fromString :: Text -> StringOrURI
- fromURI :: URI -> StringOrURI
- getString :: StringOrURI -> Maybe Text
- getURI :: StringOrURI -> Maybe URI
- newtype NumericDate = NumericDate UTCTime
Documentation
JSON Web Token data.
Constructors
| JWT | |
Fields
| |
createJWSJWT :: MonadRandom m => JWK -> JWSHeader -> ClaimsSet -> m (Either Error JWT) Source #
Create a JWT that is a JWS.
validateJWSJWT :: ValidationAlgorithms -> ValidationPolicy -> JWK -> JWT -> Bool Source #
Validate a JWT as a JWS (JSON Web Signature).
The JWT Claims Set represents a JSON object whose members are the claims conveyed by the JWT.
Constructors
| ClaimsSet | |
Fields
| |
emptyClaimsSet :: ClaimsSet Source #
Return an empty claims set.
Audience data. In the general case, the aud value is an
array of case-sensitive strings, each containing a StringOrURI
value. In the special case when the JWT has one audience, the
aud value MAY be a single case-sensitive string containing a
StringOrURI value.
Constructors
| General [StringOrURI] | |
| Special StringOrURI |
data StringOrURI Source #
A JSON string value, with the additional requirement that while arbitrary string values MAY be used, any value containing a : character MUST be a URI.
Instances
fromString :: Text -> StringOrURI Source #
Construct a StringOrURI from text
fromURI :: URI -> StringOrURI Source #
Construct a StringOrURI from a URI
getURI :: StringOrURI -> Maybe URI Source #
Get the uri from a StringOrURI
newtype NumericDate Source #
A JSON numeric value representing the number of seconds from 1970-01-01T0:0:0Z UTC until the specified UTC date/time.
Constructors
| NumericDate UTCTime |
Instances