Stability | experimental |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
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 CosePublicKey
- = CosePublicKeyEdDSA { }
- | CosePublicKeyECDSA { }
- | CosePublicKeyRSA { }
- keySignAlg :: CosePublicKey -> CoseSignAlg
- data CoseCurveEdDSA = CoseCurveEd25519
- data CoseCurveECDSA
COSE public Key
data CosePublicKey Source #
(spec) A structured representation of a COSE_Key limited to what is know to be necessary for Webauthn public keys for the credentialPublicKey field. Constructors represent signature algorithms.
CosePublicKeyEdDSA | (spec) EdDSA Signature Algorithm RFC8032 describes the elliptic curve signature scheme Edwards-curve Digital Signature Algorithm (EdDSA). In that document, the signature algorithm is instantiated using parameters for edwards25519 and edwards448 curves. The document additionally describes two variants of the EdDSA algorithm: Pure EdDSA, where no hash function is applied to the content before signing, and HashEdDSA, where a hash function is applied to the content before signing and the result of that hash function is signed. For EdDSA, the content to be signed (either the message or the pre-hash value) is processed twice inside of the signature algorithm. For use with COSE, only the pure EdDSA version is used. Security considerations are here |
| |
CosePublicKeyECDSA | (spec) ECDSA Signature Algorithm This document defines ECDSA to work only with the curves P-256, P-384, and P-521. Future documents may define it to work with other curves and points in the future. In order to promote interoperability, it is suggested that SHA-256 be used only with curve P-256, SHA-384 be used only with curve P-384, and SHA-512 be used with curve P-521. This is aligned with the recommendation in Section 4 of RFC5480. Security considerations are here |
| |
CosePublicKeyRSA | (spec) RSASSA-PKCS1-v1_5 Signature Algorithm A key of size 2048 bits or larger MUST be used with these algorithms. Security considerations are here |
|
Instances
keySignAlg :: CosePublicKey -> CoseSignAlg Source #
The COSE signing algorithm corresponding to a COSE public key
COSE Elliptic Curves
data CoseCurveEdDSA Source #
COSE elliptic curves that can be used with EdDSA
CoseCurveEd25519 | (spec) Ed25519 for use w/ EdDSA only |
Instances
data CoseCurveECDSA Source #
COSE elliptic curves that can be used with ECDSA
CoseCurveP256 | (spec) NIST P-256 also known as secp256r1 |
CoseCurveP384 | (spec) NIST P-384 also known as secp384r1 |
CoseCurveP521 | (spec) NIST P-521 also known as secp521r1 |