Stability | experimental |
---|---|
Safe Haskell | None |
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
- encodeCredentialOptionsRegistration :: CredentialOptions 'Registration -> IDLCredentialOptionsRegistration
- data IDLCredentialOptionsRegistration
- data IDLCredentialRegistration
- decodeCredentialRegistration :: SupportedAttestationStatementFormats -> IDLCredentialRegistration -> Either Text (Credential 'Registration 'True)
- encodeCredentialOptionsAuthentication :: CredentialOptions 'Authentication -> IDLCredentialOptionsAuthentication
- data IDLCredentialOptionsAuthentication
- data IDLCredentialAuthentication
- decodeCredentialAuthentication :: IDLCredentialAuthentication -> Either Text (Credential 'Authentication 'True)
Registration
encodeCredentialOptionsRegistration :: CredentialOptions 'Registration -> IDLCredentialOptionsRegistration 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 decodeCredentialRegistration
.
data IDLCredentialOptionsRegistration Source #
The intermediate type returned by encodeCredentialOptionsRegistration
,
equivalent to the PublicKeyCredentialCreationOptions
dictionary
data IDLCredentialRegistration Source #
The intermediate type as an input to decodeCredentialRegistration
,
equivalent to the PublicKeyCredential
interface with the response being an
AuthenticatorAttestationResponse.
Instances
Eq IDLCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL | |
Show IDLCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL showsPrec :: Int -> IDLCredentialRegistration -> ShowS # show :: IDLCredentialRegistration -> String # showList :: [IDLCredentialRegistration] -> ShowS # | |
ToJSON IDLCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL | |
FromJSON IDLCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL |
decodeCredentialRegistration Source #
:: SupportedAttestationStatementFormats | The attestation statement formats
that should be supported. The value of |
-> IDLCredentialRegistration | |
-> Either Text (Credential 'Registration 'True) |
Decodes the intermediate IDLCredentialRegistration
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
encodeCredentialOptionsRegistration
.
Authentication
encodeCredentialOptionsAuthentication :: CredentialOptions 'Authentication -> IDLCredentialOptionsAuthentication 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.
data IDLCredentialOptionsAuthentication Source #
The intermediate type returned by encodeCredentialOptionsAuthentication
,
equivalent to the PublicKeyCredentialRequestOptions
dictionary
data IDLCredentialAuthentication Source #
The intermediate type as an input to decodeCredentialAuthentication
,
equivalent to the PublicKeyCredential
interface with the response being an
AuthenticatorAssertionResponse.
Instances
decodeCredentialAuthentication :: IDLCredentialAuthentication -> 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 IDLCredentialAuthentication
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
TrueencodeCredentialOptionsAuthentication