/// <reference types="node" />
import { Point } from "@dedis/kyber";
import { Message, Properties } from "protobufjs/light";
/**
 * List of server identities
 */
export declare class Roster extends Message<Roster> {
    /**
     * Get the length of the roster
     * @returns the length as a number
     */
    readonly length: number;
    /**
     * @see README#Message classes
     */
    static register(): void;
    static fromBytes(b: Buffer): Roster;
    /**
     * Parse cothority roster toml string into a Roster object.
     * @example
     * // Toml needs to adhere to the following format
     * // where public has to be a hex-encoded string.
     *
     *    [[servers]]
     *        Address = "tcp://127.0.0.1:7001"
     *        Public = "4e3008c1a2b6e022fb60b76b834f174911653e9c9b4156cc8845bfb334075655"
     *        Description = "conode1"
     *    [[servers]]
     *        Address = "tcp://127.0.0.1:7003"
     *        Public = "e5e23e58539a09d3211d8fa0fb3475d48655e0c06d83e93c8e6e7d16aa87c106"
     *        Description = "conode2"
     *
     * @param data toml with the above format
     * @returns the parsed roster
     */
    static fromTOML(data: string): Roster;
    readonly id: Buffer;
    readonly list: ServerIdentity[];
    readonly aggregate: Buffer;
    private _agg;
    constructor(properties?: Properties<Roster>);
    /**
     * Get the public keys for a given service
     *
     * @param name The name of the service
     * @returns the list of points
     */
    getServicePublics(name: string): Point[];
    /**
     * Returns the list of public keys of the conodes in the roster.
     */
    getPublics(): Point[];
    /**
     * Get a subset of the roster
     *
     * @param start Index of the first identity
     * @param end   Index of the last identity, not inclusive
     * @returns the new roster
     */
    slice(start: number, end?: number): Roster;
    /**
     * Helper to encode the Roster using protobuf
     * @returns the bytes
     */
    toBytes(): Buffer;
    /**
     * Returns a toml representation of the roster, not including the service public keys.
     * @return string of toml representation
     */
    toTOML(): string;
}
/**
 * Identity of a conode
 */
export declare class ServerIdentity extends Message<ServerIdentity> {
    /**
     * Converts an HTTP-S URL to a Wesocket URL. It converts 'http' to 'ws' and 'https' to 'wss'.
     * Any other protocols are forbidden and will raise an error. It also removes any trailing '/'.
     * Here are some examples:
     *      http://example.com:77        => ws://example.com:77
     *      https://example.com/path/    => wss:example.com/path
     *      https://example.com:443/     => wss:example.com
     *      tcp://127.0.0.1              => Error
     * Note: It will NOT include the given port in the case it's the default one (for example 80 or 443).
     * Note: In the case there are many slashes at the end of the url, it will only remove one.
     * @param url   the given url field
     * @returns a websocket url
     */
    static urlToWebsocket(url: string): string;
    /**
     * @see README#Message classes
     */
    static register(): void;
    /**
     * Checks wether the address given as parameter has the right format.
     * @param address the address to check
     * @returns true if and only if the address has the right format
     */
    static isValidAddress(address: string): boolean;
    /**
     * Converts a TLS URL to a Wesocket URL and builds a complete URL with the path given as parameter.
     * @param address   the server identity to take the urlRegistered from
     * @param path      the path after the base urlRegistered
     * @returns a websocket address
     */
    static addressToWebsocket(address: string, path?: string): string;
    readonly public: Buffer;
    readonly id: Buffer;
    readonly address: string;
    readonly description: string;
    readonly serviceIdentities: ServiceIdentity[];
    readonly url: string;
    private _point;
    constructor(properties?: Properties<ServerIdentity>);
    /**
     * Get the public key of the server as a Point
     * @returns the point
     */
    getPublic(): Point;
    /**
     * Returns websocket version of this.url if set, otherwise converts the server
     * address to match the websocket format.
     * @returns the websocket address
     */
    getWebSocketAddress(): string;
}
/**
 * Identity of a service for a specific conode. Some services have their own
 * key pair and don't the default one.
 */
export declare class ServiceIdentity extends Message<ServiceIdentity> {
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly name: string;
    readonly suite: string;
    readonly public: Buffer;
    private _point;
    constructor(properties: Properties<ServiceIdentity>);
    /**
     * Get the public key as a Kyber point
     *
     * @returns the public key
     */
    getPublic(): Point;
}
