Stability | experimental |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Certain parts of the specification require that data is decoded/encoded from/to a binary form. This module holds such functions.
Synopsis
- encodeRawCollectedClientData :: forall (c :: CeremonyKind) raw. SingI c => CollectedClientData c raw -> CollectedClientData c 'True
- stripRawCollectedClientData :: CollectedClientData c raw -> CollectedClientData c 'False
- decodeCollectedClientData :: forall (c :: CeremonyKind). SingI c => ByteString -> Either Text (CollectedClientData c 'True)
- encodeRawAttestedCredentialData :: AttestedCredentialData c raw -> AttestedCredentialData c 'True
- stripRawAttestedCredentialData :: AttestedCredentialData c raw -> AttestedCredentialData c 'False
- encodeRawAuthenticatorData :: forall (c :: CeremonyKind) raw. SingI c => AuthenticatorData c raw -> AuthenticatorData c 'True
- stripRawAuthenticatorData :: AuthenticatorData c raw -> AuthenticatorData c 'False
- decodeAuthenticatorData :: forall (c :: CeremonyKind). SingI c => ByteString -> Either Text (AuthenticatorData c 'True)
- encodeRawAttestationObject :: AttestationObject raw -> AttestationObject 'True
- stripRawAttestationObject :: AttestationObject raw -> AttestationObject 'False
- encodeAttestationObject :: AttestationObject 'True -> ByteString
- decodeAttestationObject :: SupportedAttestationStatementFormats -> ByteString -> Either Text (AttestationObject 'True)
- encodeRawAuthenticatorResponse :: AuthenticatorResponse c raw -> AuthenticatorResponse c 'True
- stripRawAuthenticatorResponse :: AuthenticatorResponse c raw -> AuthenticatorResponse c 'False
- encodeRawCredential :: Credential c raw -> Credential c 'True
- stripRawCredential :: Credential c raw -> Credential c 'False
CollectedClientData
encodeRawCollectedClientData :: forall (c :: CeremonyKind) raw. SingI c => CollectedClientData c raw -> CollectedClientData c 'True Source #
(spec) Encodes
all raw fields of a CollectedClientData
into ccdRawData
using the
JSON-compatible serialization of client
data
This function is useful for testing.
stripRawCollectedClientData :: CollectedClientData c raw -> CollectedClientData c 'False Source #
Removes all raw fields of a CollectedClientData
.
decodeCollectedClientData :: forall (c :: CeremonyKind). SingI c => ByteString -> Either Text (CollectedClientData c 'True) Source #
(spec) Decodes
a CollectedClientData
from a ByteString
. This is needed to parse
the
clientDataJSON
field in the
AuthenticatorResponse
structure, which is used for both attestation and assertion.
AttestedCredentialData
encodeRawAttestedCredentialData :: AttestedCredentialData c raw -> AttestedCredentialData c 'True Source #
Encodes all raw fields of a AttestedCredentialData
, particularly
encodes acdCredentialPublicKey
using its Serialise
instance into
acdCredentialPublicKeyBytes
, see
credentialPublicKey
.
stripRawAttestedCredentialData :: AttestedCredentialData c raw -> AttestedCredentialData c 'False Source #
Removes all raw fields of a AttestedCredentialData
.
AuthenticatorData
encodeRawAuthenticatorData :: forall (c :: CeremonyKind) raw. SingI c => AuthenticatorData c raw -> AuthenticatorData c 'True Source #
(spec) Encodes all raw-containing fields of a AuthenticatorData
, particularly
adAttestedCredentialData
, and the AuthenticatorData
itself into
adRawData
. This function is needed for an authenticator implementation.
stripRawAuthenticatorData :: AuthenticatorData c raw -> AuthenticatorData c 'False Source #
Removes all raw fields from a AuthenticatorData
.
decodeAuthenticatorData :: forall (c :: CeremonyKind). SingI c => ByteString -> Either Text (AuthenticatorData c 'True) Source #
(spec) Decodes a
AuthenticatorData
from a ByteString
. This is needed to parse a
webauthn clients
authenticatorData
field in the
AuthenticatorAssertionResponse
structure.
AttestationObject
encodeRawAttestationObject :: AttestationObject raw -> AttestationObject 'True Source #
Encodes all raw fields of an AttestationObject
.
stripRawAttestationObject :: AttestationObject raw -> AttestationObject 'False Source #
Removes all raw fields of an AttestationObject
.
encodeAttestationObject :: AttestationObject 'True -> ByteString Source #
(spec) Encodes an AttestationObject
as a ByteString
. This is needed by
the client side to generate a valid JSON response.
decodeAttestationObject :: SupportedAttestationStatementFormats -> ByteString -> Either Text (AttestationObject 'True) Source #
(spec) Decodes a AttestationObject
from a ByteString
. This is needed to
parse a webauthn clients
attestationObject
field in the
AuthenticatorAttestationResponse
structure This function takes a SupportedAttestationStatementFormats
argument to indicate which attestation statement formats are supported.
structure.
AuthenticatorResponse
encodeRawAuthenticatorResponse :: AuthenticatorResponse c raw -> AuthenticatorResponse c 'True Source #
Encode all raw fields of an AuthenticatorResponse
.
stripRawAuthenticatorResponse :: AuthenticatorResponse c raw -> AuthenticatorResponse c 'False Source #
Removes all raw fields of an AuthenticatorResponse
.
Credential
encodeRawCredential :: Credential c raw -> Credential c 'True Source #
Encodes all raw fields of an Credential
.
stripRawCredential :: Credential c raw -> Credential c 'False Source #
Removes all raw fields of an Credential
.