import { CryptoInfo, Envelope, Logger, LoggerOptions, NameResolver } from '@evan.network/dbcp';
import { CryptoProvider } from './crypto-provider';
import { Profile } from '../profile/profile';
import { Sharing } from '../contracts/sharing';
/**
 * specifies which type of encryption is done
 */
export declare enum EncryptionWrapperCryptorType {
    /** content encryption is used for generic data (strings, in memory objects) */
    Content = "aes-256-cbc",
    /** file encryption is used for binary file data */
    File = "aes-blob",
    /** unencrypted data encryption can be used to embed unencrypted data in encryption containers */
    Unencrypted = "unencrypted"
}
/**
 * storage location for encryption keys
 */
export declare enum EncryptionWrapperKeyType {
    /** custom key handling means that the key is handled elsewhere and has to be given to profile */
    Custom = "custom",
    /** key is stored in profile, usually in property "encryptionKeys" */
    Profile = "profile",
    /** key is stored in Shared or MultiShared contract */
    Sharing = "sharing"
}
/**
 * encryption wrapper instance options
 */
export interface EncryptionWrapperOptions extends LoggerOptions {
    cryptoProvider: CryptoProvider;
    nameResolver: NameResolver;
    profile: Profile;
    sharing: Sharing;
    web3: any;
}
/**
 * wrapper for encryption realizes a uniform way to en- and decrypt different types of data with
 * different key storages
 *
 * @class      EncryptionWrapper (name)
 */
export declare class EncryptionWrapper extends Logger {
    static defaultOptions: {
        keyLength: number;
        algorithm: string;
    };
    private readonly encodingUnencrypted;
    private readonly encodingEncrypted;
    options: EncryptionWrapperOptions;
    constructor(options?: EncryptionWrapperOptions);
    /**
     * decrypt given ``Envelope``
     *
     * @param      {Envelope}  toDecrypt  encrypted envelop
     * @param      {any}       artifacts  additional information for decrypting
     */
    decrypt(toDecrypt: Envelope, artifacts?: {
        accountId: string;
        propertyName: string;
    } | {
        key: string;
    }): Promise<any>;
    /**
     * encrypt given object, depending on given ``cryptoInfo``, additional information may be
     * required, which can be given via ``artifacts``
     *
     * @param      {any}         toEncrypt   object to encrypt
     * @param      {CryptoInfo}  cryptoInfo  details for encryption, can be created with
     *                                       ``getCryptoInfos``
     * @param      {any}         artifacts   additional information for decrypting
     */
    encrypt(toEncrypt: any, cryptoInfo: CryptoInfo, artifacts?: {
        accountId: string;
        block?: number;
        propertyName: string;
    } | {
        key: string;
    }): Promise<Envelope>;
    /**
     * generate new encryption key, uses ``cryptoInfo`` to decide which ``cryptor`` to use for this
     *
     * @param      {CryptoInfo}  cryptoInfo  details for encryption, can be created with
     *                                       `getCryptoInfos`
     */
    generateKey(cryptoInfo: CryptoInfo): Promise<any>;
    /**
     * create new ``CryptoInfo`` instance
     *
     * @param      {string}                        keyContext   used to identify key, can be any
     *                                                          string (but must not have colons)
     * @param      {EncryptionWrapperKeyType}      keyType      defines where keys are stored
     * @param      {EncryptionWrapperCryptorType}  cryptorType  cryptor to use
     * @param      {any}                           artifacts    (optional) additional information for
     *                                                          encryption may be required, depends
     *                                                          on ``keyType``
     */
    getCryptoInfo(keyContext: string, keyType: EncryptionWrapperKeyType, cryptorType?: EncryptionWrapperCryptorType, artifacts?: {
        sharingContractId: string;
        sharingId?: string;
    }): Promise<CryptoInfo>;
    /**
     * get key for given ``cryptoInfo``
     *
     * @param      {CryptoInfo}  cryptoInfo  details for encryption, can be created with
     *                                       `getCryptoInfos`
     */
    getKey(cryptoInfo: CryptoInfo, artifacts?: {
        accountId: string;
        propertyName: string;
    } | {
        key: string;
    }): Promise<any>;
    /**
     * store key in respective storage location, depending on given cryptoInfo, additional information
     * may be required, which can be given via ``artifacts``
     *
     * @param      {CryptoInfo}  cryptoInfo  details for encryption, can be created with
     *                                       `getCryptoInfos`
     * @param      {any}         key         key to store
     * @param      {any}         artifacts   (optional) additional information for encryption may be
     *                                       required
     */
    storeKey(cryptoInfo: CryptoInfo, key: any, artifacts?: {
        accountId: string;
        receiver?: string;
    }): Promise<void>;
    /**
     * check if given artifacts contain given set of properties; throws if missing properties
     *
     * @param      {any}     artifacts   object to ckeck
     * @param      {string}  properties  list of properties to check
     */
    private checkProperties;
}
