interface · Browser and Node

# AsyncSigner

A key that may not give up its secret: WebCrypto, WebAuthn, a secure element, or a seed.

`@toip-tools/cose` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/cose/src/signers.ts#L21)

Import:

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

## Declaration

interface:

```ts
interface AsyncSigner {
  alg: CoseAlg;
  kid: Uint8Array;
  publicKey: PublicKey;
  /** Signs the Sig_structure bytes. For -65600 it returns CBOR `[authenticatorData, clientDataJSON, signature]`. */
  sign(toBeSigned: Uint8Array): Promise<Uint8Array>;
}
```

## Properties

- **`alg` (required)**: `CoseAlg`
- **`kid` (required)**: `Uint8Array<ArrayBufferLike>`
- **`publicKey` (required)**: `PublicKey`

## Methods

### `sign`

Signs the Sig\_structure bytes. For -65600 it returns CBOR `[authenticatorData, clientDataJSON, signature]`.

Signature:

```ts
sign(toBeSigned: Uint8Array): Promise<Uint8Array>;
```

#### Parameters

- **`toBeSigned` (required)**: `Uint8Array<ArrayBufferLike>`

#### Returns

`Promise<Uint8Array<ArrayBufferLike>>`

[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/AsyncSigner/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
