toip.tools

interface · Browser and Node

AsyncSigner

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

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

Declaration

TypeScriptinterface
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

algrequired
CoseAlg
kidrequired
Uint8Array<ArrayBufferLike>
publicKeyrequired
PublicKey

Methods

sign

Signs the Sig_structure bytes. For -65600 it returns CBOR [authenticatorData, clientDataJSON, signature].

TypeScriptSignature
sign(toBeSigned: Uint8Array): Promise<Uint8Array>;

Parameters

toBeSignedrequired
Uint8Array<ArrayBufferLike>

Returns

Promise<Uint8Array<ArrayBufferLike>>