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<string>;
/**
 * 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<KeyInfo>;
    findKeyById(id: string): Promise<KeyInfo>;
    importKey(name: string, key: PrivateKey): Promise<KeyInfo>;
    exportKey(name: string): Promise<PrivateKey>;
    removeKey(name: string): Promise<KeyInfo>;
    /**
     * List all the keys.
     *
     * @returns {Promise<KeyInfo[]>}
     */
    listKeys(): Promise<KeyInfo[]>;
    /**
     * 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<KeyInfo>}
     */
    renameKey(oldName: string, newName: string): Promise<KeyInfo>;
    /**
     * Rotate keychain password and re-encrypt all associated keys
     */
    rotateKeychainPass(oldPass: string, newPass: string): Promise<void>;
}
export {};
//# sourceMappingURL=keychain.d.ts.map