/** * This file contains functions for importing and exporting node's native * `ed25519` crypto keys in `der` format used to sign and verify ledger * records when executing in node environment. * In ledger transport we use raw keys without prefixes encoded in * base64, 44 characters in length. * Native `der` keys created with `crypto` library are prefixed with an ASN.1 * hex prefixes when exported or imported: * - public key: `302a300506032b6570032100` * - private key: `302e020100300506032b657004220420` * So we need to strip this prefix when we export `der` key to raw key, * or prepend when we import `der` key from raw key. * see: https://datatracker.ietf.org/doc/html/rfc8410 (sections 9 and 10) */ import { KeyObject } from 'crypto'; /** * Exports public `der` key to raw key format * @param key public key in `der`format * @returns public key in raw format */ export declare function exportPublicKey(key: KeyObject): string; /** * Exports private `der` key to raw key format * @param key private key in `der` format * @returns private key in raw format */ export declare function exportPrivateKey(key: KeyObject): string; /** * Imports public `der` key from raw key format * @param key public key in raw format * @returns public key in `der` format */ export declare function importPublicKey(key: string, format?: string): KeyObject; /** * Imports private `der` key from raw key format * @param key private key in raw format * @returns private key in `der` format */ export declare function importPrivateKey(key: string): KeyObject;