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

Crypto.WebAuthn.Cose.Internal.Verify

Description

public keys and signature algorithms are represented with three different types:

  • CoseSignAlg, which is the signature algorithm used, equivalent to a COSE Algorithm from the COSE registry
  • CosePublicKey, which is a combination of a CoseSignAlg along with a public key that can be used with it. This is what the COSE_Key CBOR structure decodes to
  • PublicKey, only the public key part of CosePublicKey

The following main operations are supported for these types:

Synopsis

Public Key

fromX509 :: PubKey -> Either Text PublicKey Source #

Turns a X.509 certificates PubKey into a PublicKey

Signature verification

verify :: PublicKeyWithSignAlg -> ByteString -> ByteString -> Either Text () Source #

Verifies an asymmetric signature for a message using a PublicKeyWithSignAlg Returns an error if the signature algorithm doesn't match. Also returns an error if the signature wasn't valid or for other errors.

Hash Conversions to cryptonite types

data SomeHashAlgorithm Source #

Some cryptonite HashAlgorithm type, used as a return value of toCryptHashECDSA

Constructors

forall a.HashAlgorithm a => SomeHashAlgorithm a 

toCryptHashECDSA :: CoseHashAlgECDSA -> SomeHashAlgorithm Source #

Returns the cryptonite SomeHashAlgorithm corresponding to this hash algorithm

data SomeHashAlgorithmASN1 Source #

Some cryptonite HashAlgorithmASN1 type, used as a return value of toCryptHashRSA

Constructors

forall a.HashAlgorithmASN1 a => SomeHashAlgorithmASN1 a 

toCryptHashRSA :: CoseHashAlgRSA -> SomeHashAlgorithmASN1 Source #

Returns the cryptonite SomeHashAlgorithmASN1 corresponding to this hash algorithm