toip.tools

function · Browser and Node

webCryptoSigner

A signer from a WebCrypto key pair: Ed25519, or ECDSA P-256. The private key may be non-extractable; only the public key is exported. WebCrypto's ECDSA output is already the raw r || s that COSE wants.

@toip-tools/coseView source
TypeScriptImport
import { webCryptoSigner } from "@toip-tools/cose";

Declaration

TypeScriptSignature
webCryptoSigner(key: CryptoKeyPair, kid: Uint8Array, alg?: CoseAlg): Promise<AsyncSigner>;

Parameters

keyrequired
CryptoKeyPair
kidrequired
Uint8Array<ArrayBufferLike>
algoptional
CoseAlg | undefined

Returns

Promise<AsyncSigner>