API reference · Browser and Node
@toip-tools/cose
24 public exports.
import { ALG, type AsyncSigner, type CoseAlg } from "@toip-tools/cose";
Functions
-
curveOf -
decodeCbor -
encodeCbor -
seedSignerAn Ed25519 signer from a 32-byte seed.
-
signCose1 -
sigStructureThe bytes a COSE_Sign1 signature covers: `["Signature1", protected, external_aad, payload]`.
-
verifyCose1 -
webAuthnSignerA passkey as a signer (alg -65600).
-
webCryptoSignerA signer from a WebCrypto key pair: Ed25519, or ECDSA P-256.
Classes
-
TaggedA wrapper class for representing a CBOR tag with an arbitrary nested value.
Interfaces
-
AsyncSignerA key that may not give up its secret: WebCrypto, WebAuthn, a secure element, or a seed.
-
CoseVerified -
DecodeCborOptions -
PublicKey -
SignOptions -
VerifyOptions -
WebAuthnInfo
Types
-
CoseAlgEd25519 (-19), ESP256 (-9), EdDSA (-8), ES256 (-7), and the private-use WebAuthn-wrapped ES256 (-65600).
-
CoseFailure -
Curve -
KeyLookupFinds the keys that may have signed: for a device, its current key and, around a rotation, the previous one.
-
VerifyResult -
WebAuthnGet`navigator.credentials.get`, or a stand-in for tests.
Constants
Signatures and source documentation are generated from packages/cose/src/index.ts.