webauthn-0.1.0.0: Relying party (server) implementation of the WebAuthn 2 specification
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Crypto.WebAuthn.Model.WebIDL

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

Registration

encodeCredentialOptionsRegistration :: CredentialOptions 'Registration -> IDLCredentialOptionsRegistration Source #

Encodes a CredentialOptions Registration, which is needed for the registration ceremony. The resulting type from this function can be encoded using 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.

decodeCredentialRegistration Source #

Arguments

:: SupportedAttestationStatementFormats

The attestation statement formats that should be supported. The value of allSupportedFormats can be passed here, but additional or custom formats may also be used if needed

-> 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 Credential Registration. This is the continuation of encodeCredentialOptionsRegistration.

Authentication

encodeCredentialOptionsAuthentication :: CredentialOptions 'Authentication -> IDLCredentialOptionsAuthentication Source #

Encodes a CredentialOptions Authentication, which is needed for the authentication ceremony. The resulting type from this function can be encoded using 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.

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 Credential Authentication True. This is the continuation of encodeCredentialOptionsAuthentication