Stability | experimental |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Crypto.WebAuthn.Model.WebIDL
Contents
Description
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
Instances
Eq IDLCredentialOptionsRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL | |
Show IDLCredentialOptionsRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL Methods showsPrec :: Int -> IDLCredentialOptionsRegistration -> ShowS # | |
ToJSON IDLCredentialOptionsRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL |
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 Methods (==) :: IDLCredentialRegistration -> IDLCredentialRegistration -> Bool # (/=) :: IDLCredentialRegistration -> IDLCredentialRegistration -> Bool # | |
Show IDLCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL Methods showsPrec :: Int -> IDLCredentialRegistration -> ShowS # show :: IDLCredentialRegistration -> String # showList :: [IDLCredentialRegistration] -> ShowS # | |
ToJSON IDLCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL Methods toJSON :: IDLCredentialRegistration -> Value # toEncoding :: IDLCredentialRegistration -> Encoding # toJSONList :: [IDLCredentialRegistration] -> Value # | |
FromJSON IDLCredentialRegistration Source # | |
Defined in Crypto.WebAuthn.Model.WebIDL Methods parseJSON :: Value -> Parser IDLCredentialRegistration # parseJSONList :: Value -> Parser [IDLCredentialRegistration] # |
decodeCredentialRegistration Source #
Arguments
:: 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
Instances
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