import { AxiosInstance } from 'axios';
import { IDerivedKey, IKey, KeyInformation } from '../../index.js';
import { Keys } from '../types.js';
/**
 * An interface abstracting the connection between the SDK module and the actual key storage implementation.
 * In the future, a user might be able to select where they want to store their keys, such as MintBlue API vs AWS CloudHSM.
 */
export interface IDerivationService {
    /**
     * Get the master key for encryption and decryption operations.
     */
    getMasterKey(): CryptoKey;
    /**
     * Save a key with a specific name to the key storage.
     * @param derivationKey The key or derived key to be saved.
     * @param name The name associated with the key.
     */
    saveKey(derivationKey: IKey | IDerivedKey, name: string, keyProtected: boolean): Promise<void>;
    /**
     * Retrieve a map of keys from the key storage.
     * @returns A promise that resolves to a map of keys.
     */
    getKeys(): Promise<Map<string, APIDerivation>>;
}
/**
 * Serialize the key information to a string format.
 * @param keyInfo The KeyInformation object to be serialized.
 * @returns The serialized string representation of the KeyInformation.
 */
export declare function serialiseKeyInformation(keyInfo: KeyInformation): string;
/**
 * Deserialize a serialized string to obtain the KeyInformation object.
 * @param parsed The serialized string representation of KeyInformation.
 * @returns The deserialized KeyInformation object.
 */
export declare function deserialiseKeyInformation(parsed: string): KeyInformation;
export interface APIDerivation {
    id: string;
    name: string;
    path: string;
    pubkey: string;
    public: boolean;
    fingerprint: string;
    user_id: string;
    account_id: string;
    created_at: string;
    updated_at: string;
}
type Fingerprint = string;
/**
 * A service class for interacting with derivations API
 */
export declare class APIDerivationService implements IDerivationService {
    private api;
    private keys;
    /**
     * Constructor for the APIDerivationService class.
     * @param api The AxiosInstance used for API communication.
     * @param keys The MintBlue key storage configuration.
     */
    constructor(api: AxiosInstance, keys: Keys);
    /**
     * Get the master key for encryption and decryption operations.
     * @returns The CryptoKey representing the master key.
     */
    getMasterKey(): CryptoKey;
    /**
     * Retrieve the list of keys from the API.
     * @returns A promise that resolves to a map of APIDerivation objects by fingerprint.
     */
    getKeys(): Promise<Map<Fingerprint, APIDerivation>>;
    /**
     * Save a key by posting it to the API.
     * @param derivationKey The key or derived key to be saved.
     * @param name The name associated with the key.
     */
    saveKey(derivationKey: IKey | IDerivedKey, name: string, keyProtected?: boolean): Promise<void>;
}
export {};
