| Stability | experimental |
|---|---|
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Crypto.WebAuthn.Encoding.WebAuthnJson
Contents
Description
This module contains functions and types for encoding CredentialOptions
and decoding Credentials, based on intermediate types that implement the
ToJSON and FromJSON types respectively, matching the serialization used
by webauthn-json.
Synopsis
- wjEncodeCredentialOptionsRegistration :: CredentialOptions 'Registration -> WJCredentialOptionsRegistration
- newtype WJCredentialOptionsRegistration = WJCredentialOptionsRegistration {}
- newtype WJCredentialRegistration = WJCredentialRegistration {}
- wjDecodeCredentialRegistration' :: SupportedAttestationStatementFormats -> WJCredentialRegistration -> Either Text (Credential 'Registration 'True)
- wjDecodeCredentialRegistration :: WJCredentialRegistration -> Either Text (Credential 'Registration 'True)
- wjEncodeCredentialOptionsAuthentication :: CredentialOptions 'Authentication -> WJCredentialOptionsAuthentication
- newtype WJCredentialOptionsAuthentication = WJCredentialOptionsAuthentication {}
- newtype WJCredentialAuthentication = WJCredentialAuthentication {}
- wjDecodeCredentialAuthentication :: WJCredentialAuthentication -> Either Text (Credential 'Authentication 'True)
Registration
wjEncodeCredentialOptionsRegistration :: CredentialOptions 'Registration -> WJCredentialOptionsRegistration Source #
Encodes a , which is needed for the
registration ceremony. The
resulting type from this function can be encoded using CredentialOptions RegistrationtoJSON,
sent as a response, received by the Relying Party script, passed directly as the publicKey
field in the argument to webauthn-json's create() (or equivalent) function. The result of that function can then be decoded using wjDecodeCredentialRegistration.
newtype WJCredentialOptionsRegistration Source #
The intermediate type returned by wjEncodeCredentialOptionsRegistration,
equivalent to the PublicKeyCredentialCreationOptions dictionary
Constructors
| WJCredentialOptionsRegistration | |
Instances
newtype WJCredentialRegistration Source #
The intermediate type as an input to wjDecodeCredentialRegistration,
equivalent to the PublicKeyCredential
interface with the response being an
AuthenticatorAttestationResponse.
Constructors
| WJCredentialRegistration | |
Instances
| FromJSON WJCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Encoding.WebAuthnJson Methods parseJSON :: Value -> Parser WJCredentialRegistration # parseJSONList :: Value -> Parser [WJCredentialRegistration] # | |
| ToJSON WJCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Encoding.WebAuthnJson Methods toJSON :: WJCredentialRegistration -> Value # toEncoding :: WJCredentialRegistration -> Encoding # toJSONList :: [WJCredentialRegistration] -> Value # | |
| Show WJCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Encoding.WebAuthnJson Methods showsPrec :: Int -> WJCredentialRegistration -> ShowS # show :: WJCredentialRegistration -> String # showList :: [WJCredentialRegistration] -> ShowS # | |
| Eq WJCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Encoding.WebAuthnJson Methods (==) :: WJCredentialRegistration -> WJCredentialRegistration -> Bool # (/=) :: WJCredentialRegistration -> WJCredentialRegistration -> Bool # | |
wjDecodeCredentialRegistration' Source #
Arguments
| :: SupportedAttestationStatementFormats | The attestation statement formats
that should be supported. The value of |
| -> WJCredentialRegistration | |
| -> Either Text (Credential 'Registration 'True) |
Decodes the intermediate WJCredentialRegistration type which can be
parsed with fromJSON from the result of
webauthn-json's
create() (or equivalent)
function, to a . This is the continuation
of Credential RegistrationwjEncodeCredentialOptionsRegistration.
wjDecodeCredentialRegistration :: WJCredentialRegistration -> Either Text (Credential 'Registration 'True) Source #
A version of wjDecodeCredentialRegistration' with allSupportedFormats passed as the supported formats
Authentication
wjEncodeCredentialOptionsAuthentication :: CredentialOptions 'Authentication -> WJCredentialOptionsAuthentication Source #
Encodes a , which is needed for the
authentication ceremony. The
resulting type from this function can be encoded using CredentialOptions AuthenticationtoJSON,
sent as a response, received by the Relying Party script, parsed as JSON,
and passed directly as the publicKey
field in the argument to the navigator.credentials.get()
function.
newtype WJCredentialOptionsAuthentication Source #
The intermediate type returned by wjEncodeCredentialOptionsAuthentication,
equivalent to the PublicKeyCredentialRequestOptions dictionary
Constructors
| WJCredentialOptionsAuthentication | |
Instances
newtype WJCredentialAuthentication Source #
The intermediate type as an input to wjDecodeCredentialAuthentication,
equivalent to the PublicKeyCredential
interface with the response being an
AuthenticatorAssertionResponse.
Constructors
| WJCredentialAuthentication | |
Instances
wjDecodeCredentialAuthentication :: WJCredentialAuthentication -> Either Text (Credential 'Authentication 'True) Source #
Decodes a RequestedPublicKeyCredential result, corresponding to the
PublicKeyCredential interface
as returned by the get()
method while Verifying an Authentication Assertion
| Decodes the intermediate WJCredentialAuthentication type which can be
parsed with fromJSON from the result of
webauthn-json's
get() (or equivalent)
function, to a . This is the continuation
of Credential Authentication TruewjEncodeCredentialOptionsAuthentication