import { serviceCapabilities } from '@libp2p/interface'; import type { KeychainComponents, KeychainInit, Keychain as KeychainInterface, KeyInfo } from './index.js'; import type { PrivateKey } from '@libp2p/interface'; declare const defaultOptions: { dek: { keyLength: number; iterationCount: number; salt: string; hash: string; }; }; export declare function keyId(key: PrivateKey): Promise; /** * Manages the life cycle of a key. Keys are encrypted at rest using PKCS #8. * * A key in the store has two entries * - '/info/*key-name*', contains the KeyInfo for the key * - '/pkcs8/*key-name*', contains the PKCS #8 for the key * */ export declare class Keychain implements KeychainInterface { private readonly components; private readonly init; private readonly log; private readonly self; /** * Creates a new instance of a key chain */ constructor(components: KeychainComponents, init: KeychainInit); readonly [Symbol.toStringTag] = "@libp2p/keychain"; readonly [serviceCapabilities]: string[]; /** * Generates the options for a keychain. A random salt is produced. * * @returns {object} */ static generateOptions(): KeychainInit; /** * Gets an object that can encrypt/decrypt protected data. * The default options for a keychain. * * @returns {object} */ static get options(): typeof defaultOptions; findKeyByName(name: string): Promise; findKeyById(id: string): Promise; importKey(name: string, key: PrivateKey): Promise; exportKey(name: string): Promise; removeKey(name: string): Promise; /** * List all the keys. * * @returns {Promise} */ listKeys(): Promise; /** * Rename a key * * @param {string} oldName - The old local key name; must already exist. * @param {string} newName - The new local key name; must not already exist. * @returns {Promise} */ renameKey(oldName: string, newName: string): Promise; /** * Rotate keychain password and re-encrypt all associated keys */ rotateKeychainPass(oldPass: string, newPass: string): Promise; } export {}; //# sourceMappingURL=keychain.d.ts.map