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/cose` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/cose/src/signers.ts#L47)

Import:

```ts
import { webCryptoSigner } from "@toip-tools/cose";
```

## Declaration

Signature:

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

### Parameters

- **`key` (required)**: `CryptoKeyPair`
- **`kid` (required)**: `Uint8Array<ArrayBufferLike>`
- **`alg` (optional)**: `CoseAlg | undefined`

### Returns

`Promise<AsyncSigner>`

[Usage guide](https://toip.tools/toolkit/cose/#usage) · [Error handling](https://toip.tools/toolkit/cose/#errors) · [All exports](https://toip.tools/toolkit/cose/api/)

---

This is the Markdown version of https://toip.tools/toolkit/cose/api/webCryptoSigner/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
