import { KeyProvider, Logger, LoggerOptions } from '@evan.network/dbcp';
import { CryptoProvider } from './encryption/crypto-provider';
import { Mail, Mailbox } from './mailbox';
/**
 * parameters for KeyExchange constructor
 */
export interface KeyExchangeOptions extends LoggerOptions {
    account: string;
    cryptoProvider: CryptoProvider;
    defaultCryptoAlgo: string;
    keyProvider: KeyProvider;
    mailbox: Mailbox;
    privateKey?: string;
    publicKey?: string;
}
/**
 * The KeyExchange module is used to exchange communication keys between two parties, assuming that
 * both have created a profile and public have a public facing partial Diffie Hellman key part (the
 * combination of their own secret and the shared secret)
 *
 * @class      KeyExchange (name)
 */
export declare class KeyExchange extends Logger {
    private SHARED_SECRET;
    private diffieHellman;
    private COMM_KEY_CONTEXT;
    private mailbox;
    private cryptoProvider;
    private defaultCryptoAlgo;
    private account;
    private keyProvider;
    private aes;
    publicKey: string;
    /**
     * Creates an instance of KeyExchange.
     * @param {KeyExchangeOptions} options
     * @memberof KeyExchange
     */
    constructor(options: KeyExchangeOptions);
    /**
     * combines given partial key from another profile with own private key
     *
     * @param      {string}  partialKey  publicKey(shared + private) from another profile
     * @return     {string}  combined exchange key
     */
    computeSecretKey(partialKey: string): any;
    /**
     * decrypts a given communication key with an exchange key
     *
     * @param      {string}           encryptedCommKey  encrypted communications key received from another account
     * @param      {string}           exchangeKey       Diffie Hellman exchange key from computeSecretKey
     * @return     {Promise<Buffer>}  commKey as a buffer
     */
    decryptCommKey(encryptedCommKey: string, exchangeKey: string): Promise<Buffer>;
    /**
     * returns the public and private key from the diffieHellman
     *
     * @return     {any}  public and private key from the diffieHellman.
     */
    getDiffieHellmanKeys(): {
        publicKey: any;
        privateKey: any;
    };
    /**
     * generates a new communication key end returns the hex string
     *
     * @return     {string}  comm key as string
     */
    generateCommKey(): Promise<any>;
    /**
     * creates a bmail for exchanging comm keys
     *
     * @param      {string}  from              sender accountId
     * @param      {any}     mailContent       bmail metadata
     * @param      {string}  encryptedCommKey  comm key, that should be exchanged
     * @return     {Mail}    bmail for key exchange
     */
    getExchangeMail: (from: string, mailContent: any, encryptedCommKey?: string) => Mail;
    /**
     * sends a mailbox mail to the target account with the partial key for the key exchange
     *
     * @param      {string}         targetAccount    receiver of the invitation
     * @param      {string}         targetPublicKey  combination of shared secret plus targetAccounts
     *                                               private secret
     * @param      {string}         commKey          communication key between sender and
     *                                               targetAccount
     * @param      {any}            mailContent      mail to send
     * @return     {Promise<void>}  resolved when done
     */
    sendInvite(targetAccount: string, targetPublicKey: string, commKey: string, mailContent: any): Promise<void>;
    /**
     * set the private and public key on the current diffieHellman object
     *
     * @param      {string}  publicKey   public Diffie Hellman key
     * @param      {string}  privateKey  private Diffie Hellman key
     */
    setPublicKey(publicKey: string, privateKey: string): void;
}
