toip.tools

function · Browser and Node

signCose1

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

Declaration

TypeScriptSignature
signCose1(payload: Uint8Array, signer: AsyncSigner, opts?: SignOptions): Promise<Uint8Array>;

Parameters

payloadrequired
Uint8Array<ArrayBufferLike>
signerrequired
AsyncSigner
optsoptional
SignOptions

Default: {}

Fields of opts
contentTypeoptional
string | number | undefined

Header 3: a media type, or a CoAP content-format number.

omitKidoptional
boolean | undefined

Leave the kid out of the protected header (radio frames).

unprotectedoptional
Map<number, unknown> | undefined

Unprotected header parameters. Default: none.

externalAadoptional
Uint8Array<ArrayBufferLike> | undefined

Bound into the signature but not sent (RFC 9052 §4.3).

Returns

Promise<Uint8Array<ArrayBufferLike>>