| Stability | experimental |
|---|---|
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Crypto.WebAuthn.Cose.PublicKeyWithSignAlg
Contents
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
- data PublicKeyWithSignAlg where
- pattern PublicKeyWithSignAlg :: PublicKey -> CoseSignAlg -> PublicKeyWithSignAlg
- type CosePublicKey = PublicKeyWithSignAlg
- makePublicKeyWithSignAlg :: PublicKey -> CoseSignAlg -> Either Text PublicKeyWithSignAlg
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 |
Instances
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.