import { IConversionOptions } from "protobufjs"; import { Link } from "./link"; import { stratumn } from "./proto/chainscript_pb"; /** * Convert a plain object to a signature. * @param s plain object. */ export declare function fromObject(s: any): Signature; /** * Sign bytes with the current signature version. * @param key private key in PEM format (generated by @stratumn/js-crypto). * @param toSign bytes that should be signed. */ export declare function sign(key: Uint8Array, toSign: Uint8Array): Signature; /** * Sign configurable parts of the given link with the current signature * version. * The payloadPath is used to select what parts of the link need to be signed * with the given private key. If no payloadPath is provided, the whole link * is signed. * @param key private key in PEM format (generated by @stratumn/js-crypto). * @param link that should be signed. * @param payloadPath link parts that should be signed. */ export declare function signLink(key: Uint8Array, link: Link, payloadPath: string): Signature; /** * A signature of configurable parts of a link. * Different signature types and versions are allowed to sign different * encodings of the data, but we recommend signing a hash of the * protobuf-encoded bytes. */ export declare class Signature { private s; constructor(s: stratumn.chainscript.ISignature); /** * @returns the version of the signature scheme. */ version(): string; /** * @returns the algorithm used (for example, "EdDSA"). */ type(): string; /** * @returns a description of the parts of the link that are signed. */ payloadPath(): string; /** * @returns the public key of the signer. */ publicKey(): Uint8Array; /** * @returns the signature bytes. */ signature(): Uint8Array; /** * Convert to a plain object. * @argument conversionOpts specify how to convert certain types. * @returns a plain object. */ toObject(conversionOpts?: IConversionOptions): any; /** * Validate the signature and throw an exception if invalid. * @param link the link signed. */ validate(link: Link): void; } //# sourceMappingURL=signature.d.ts.map