Stability | experimental |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module contains functions and types for encoding CredentialOptions
and decoding Credential
s, 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
Registration
toJSON
,
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
newtype WJCredentialRegistration Source #
The intermediate type as an input to wjDecodeCredentialRegistration
,
equivalent to the PublicKeyCredential
interface with the response being an
AuthenticatorAttestationResponse.
Instances
wjDecodeCredentialRegistration' Source #
:: 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
Registration
wjEncodeCredentialOptionsRegistration
.
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
Authentication
toJSON
,
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
newtype WJCredentialAuthentication Source #
The intermediate type as an input to wjDecodeCredentialAuthentication
,
equivalent to the PublicKeyCredential
interface with the response being an
AuthenticatorAssertionResponse.
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