/// <reference types="node" />
import { Point, Scalar } from "@dedis/kyber";
import { Message, Properties } from "protobufjs/light";
import { ByzCoinRPC, InstanceID, Proof } from "../byzcoin";
import { Signer } from "../darc";
import { Roster, ServerIdentity } from "../network";
/**
 * OnChainSecretRPC is used to contact the OnChainSecret service of the cothority.
 * With it you can set up a new long-term onchain-secret, give it a policy to accept
 * new requests, and ask for re-encryption requests.
 */
export declare class OnChainSecretRPC {
    bc: ByzCoinRPC;
    static serviceID: string;
    private socket;
    private readonly list;
    constructor(bc: ByzCoinRPC, roster?: Roster);
    createLTS(r: Roster, darcID: InstanceID, signers: Signer[]): Promise<CreateLTSReply>;
    authorize(who: ServerIdentity, bcid: InstanceID): Promise<AuthorizeReply>;
    /**
     * authorizeRoster is a convenience method that authorizes all nodes in the bc-roster
     * to create new LTS. For this to work, the nodes must have been started with
     * COTHORITY_ALLOW_INSECURE_ADMIN=true
     *
     * @param roster if given, this roster is used instead of the bc-roster
     */
    authorizeRoster(roster?: Roster): Promise<void>;
    reencryptKey(write: Proof, read: Proof): Promise<DecryptKeyReply>;
}
/**
 * LongTermSecret extends the OnChainSecretRPC and also holds the id and the X.
 */
export declare class LongTermSecret extends OnChainSecretRPC {
    id: InstanceID;
    X: Point;
    /**
     * fromService returns a new LongTermSecret given a ByzCoinRPC and an LTSID
     * @param bc pointing to the ByzCoin holding the LTS definition
     * @param ltsid which LTSID to look up
     * @param roster can be set if known, else the byzcoin-instance will be looked up.
     */
    static fromService(bc: ByzCoinRPC, ltsid: InstanceID, roster?: Roster): Promise<LongTermSecret>;
    /**
     * spawn creates a new longtermsecret by spawning a longTermSecret instance, and then performing
     * a DKG using the full roster of bc.
     *
     * @param bc a valid ByzCoin instance
     * @param darcID id of a darc allowed to spawn longTermSecret
     * @param signers needed to authenticate longTermSecret spawns
     * @param roster if given, the roster for the DKG, if null, the full roster of bc will be used
     */
    static spawn(bc: ByzCoinRPC, darcID: InstanceID, signers: Signer[], roster?: Roster): Promise<LongTermSecret>;
    constructor(bc: ByzCoinRPC, id: InstanceID, X: Point, roster?: Roster);
}
/**
 * Authorize is used to add the given ByzCoinID into the list of authorized IDs.
 */
export declare class Authorize extends Message<Authorize> {
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly byzcoinid: InstanceID;
    constructor(props?: Properties<Authorize>);
}
/**
 * AuthorizeReply is returned upon successful authorisation.
 */
export declare class AuthorizeReply extends Message<AuthorizeReply> {
    /**
     * @see README#Message classes
     */
    static register(): void;
}
/**
 * CreateLTS is used to start a DKG and store the private keys in each node.
 * Prior to using this request, the Calypso roster must be recorded on the
 * ByzCoin blockchain in the instance specified by InstanceID.
 */
export declare class CreateLTS extends Message<CreateLTS> {
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly proof: Proof;
    constructor(props?: Properties<CreateLTS>);
}
/**
 * CreateLTSReply is returned upon successfully setting up the distributed
 * key.
 */
export declare class CreateLTSReply extends Message<CreateLTSReply> {
    readonly X: Point;
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly byzcoinid: InstanceID;
    readonly instanceid: InstanceID;
    readonly x: Buffer;
}
/**
 * DecryptKey is sent by a reader after he successfully stored a 'Read' request
 * in byzcoin Client.
 */
export declare class DecryptKey extends Message<DecryptKey> {
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly read: Proof;
    readonly write: Proof;
    constructor(props?: Properties<DecryptKey>);
}
/**
 * DecryptKeyReply is returned if the service verified successfully that the
 * decryption request is valid.
 */
export declare class DecryptKeyReply extends Message<DecryptKeyReply> {
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly c: Buffer;
    readonly xhatenc: Buffer;
    readonly x: Buffer;
    decrypt(priv: Scalar): Promise<Buffer>;
}
/**
 * LtsInstanceInfo is the information stored in an LTS instance.
 */
export declare class LtsInstanceInfo extends Message<LtsInstanceInfo> {
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly roster: Roster;
    constructor(props?: Properties<LtsInstanceInfo>);
}
/**
 * GetLTSReply will return a stored LTS entry.
 */
export declare class GetLTSReply extends Message<GetLTSReply> {
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly ltsid: InstanceID;
}
