Kit
Functions

signBytes

signBytes(key, data): Promise<SignatureBytes>

Given a private CryptoKey and a Uint8Array of bytes, this method will return the 64-byte Ed25519 signature of that data as a Uint8Array.

Parameters

ParameterType
keyCryptoKey
dataReadonlyUint8Array

Returns

Promise<SignatureBytes>

Example

import { signBytes } from '@solana/keys';
 
const data = new Uint8Array([1, 2, 3]);
const signature = await signBytes(privateKey, data);

On this page