webauthn-0.5.0.1: Relying party (server) implementation of the WebAuthn 2 specification
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crypto.WebAuthn.Cose.PublicKeyWithSignAlg

Description

This module contains a partial implementation of the COSE_Key format, limited to what is needed for Webauthn, and in a structured way.

Synopsis

COSE public Key

data PublicKeyWithSignAlg where Source #

A combination of a PublicKey holding the public key data and a CoseSignAlg holding the exact signature algorithm that should be used. This type can only be constructed with makePublicKeyWithSignAlg, which ensures that the signature scheme matches between PublicKey and CoseSignAlg. This type is equivalent to a COSE public key, which holds the same information, see CosePublicKey

Bundled Patterns

pattern PublicKeyWithSignAlg :: PublicKey -> CoseSignAlg -> PublicKeyWithSignAlg

Deconstructs a makePublicKeyWithSignAlg into its PublicKey and CoseSignAlg. Since makePublicKeyWithSignAlg can only be constructed using makePublicKeyWithSignAlg, we can be sure that the signature scheme of PublicKey and CoseSignAlg matches.

Instances

Instances details
ToJSON PublicKeyWithSignAlg Source # 
Instance details

Defined in Crypto.WebAuthn.Cose.PublicKeyWithSignAlg

Generic PublicKeyWithSignAlg Source # 
Instance details

Defined in Crypto.WebAuthn.Cose.PublicKeyWithSignAlg

Associated Types

type Rep PublicKeyWithSignAlg :: Type -> Type #

Show PublicKeyWithSignAlg Source # 
Instance details

Defined in Crypto.WebAuthn.Cose.PublicKeyWithSignAlg

Eq PublicKeyWithSignAlg Source # 
Instance details

Defined in Crypto.WebAuthn.Cose.PublicKeyWithSignAlg

Serialise CosePublicKey Source #

CBOR encoding as a COSE_Key using the CTAP2 canonical CBOR encoding form

Instance details

Defined in Crypto.WebAuthn.Cose.PublicKeyWithSignAlg

type Rep PublicKeyWithSignAlg Source # 
Instance details

Defined in Crypto.WebAuthn.Cose.PublicKeyWithSignAlg

type Rep PublicKeyWithSignAlg = D1 ('MetaData "PublicKeyWithSignAlg" "Crypto.WebAuthn.Cose.PublicKeyWithSignAlg" "webauthn-0.5.0.1-inplace" 'False) (C1 ('MetaCons "PublicKeyWithSignAlgInternal" 'PrefixI 'True) (S1 ('MetaSel ('Just "publicKeyInternal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PublicKey) :*: S1 ('MetaSel ('Just "signAlgInternal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CoseSignAlg)))

type CosePublicKey = PublicKeyWithSignAlg Source #

(spec) A structured and checked representation of a COSE_Key, limited to what is know to be necessary for Webauthn public keys for the credentialPublicKey field.

makePublicKeyWithSignAlg :: PublicKey -> CoseSignAlg -> Either Text PublicKeyWithSignAlg Source #

Constructs a PublicKeyWithSignAlg from a PublicKey and CoseSignAlg, returning an error if the signature schemes between these two types don't match.