{-# LANGUAGE TypeFamilies #-}
module Crypto.WebAuthn.AttestationStatementFormat.None
( format,
Format (..),
)
where
import qualified Codec.CBOR.Term as CBOR
import qualified Crypto.WebAuthn.Model.Types as M
import qualified Data.Text as Text
import Data.Void (Void)
data Format = Format
instance Show Format where
show :: Format -> String
show = Text -> String
Text.unpack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. AttestationStatementFormat a => a -> Text
M.asfIdentifier
instance M.AttestationStatementFormat Format where
type AttStmt Format = ()
asfIdentifier :: Format -> Text
asfIdentifier Format
_ = Text
"none"
asfDecode :: Format -> HashMap Text Term -> Either Text (AttStmt Format)
asfDecode Format
_ HashMap Text Term
_ = forall a b. b -> Either a b
Right ()
asfEncode :: Format -> AttStmt Format -> Term
asfEncode Format
_ AttStmt Format
_ = [(Term, Term)] -> Term
CBOR.TMap []
type AttStmtVerificationError Format = Void
asfVerify :: Format
-> DateTime
-> AttStmt Format
-> AuthenticatorData 'Registration 'True
-> ClientDataHash
-> Validation
(NonEmpty (AttStmtVerificationError Format)) SomeAttestationType
asfVerify Format
_ DateTime
_ AttStmt Format
_ AuthenticatorData 'Registration 'True
_ ClientDataHash
_ = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (k :: AttestationKind).
AttestationType k -> SomeAttestationType
M.SomeAttestationType AttestationType 'Unverifiable
M.AttestationTypeNone
asfTrustAnchors :: Format -> VerifiableAttestationType -> CertificateStore
asfTrustAnchors Format
_ VerifiableAttestationType
_ = forall a. Monoid a => a
mempty
format :: M.SomeAttestationStatementFormat
format :: SomeAttestationStatementFormat
format = forall a.
AttestationStatementFormat a =>
a -> SomeAttestationStatementFormat
M.SomeAttestationStatementFormat Format
Format