import * as pkcs11 from "pkcs11js"; import * as core from "../core"; import * as mech from "../mech"; import { Session } from "../session"; import { Key } from '../objects'; import * as types from '../types'; /** * Represents signing operation */ export declare class Sign extends core.BaseObject { /** * Session */ session: Session; /** * Creates a new instance of signing operation * @param session Session * @param alg The signing mechanism * @param key The signing key * @param lib PKCS#11 library */ constructor(session: Session, alg: mech.MechanismType, key: Key, lib: pkcs11.PKCS11); /** * Continues a multiple-part signature operation, where the signature is (will be) an appendix to the data * @param data The data to be signed */ update(data: types.CryptoData): void; /** * Finishes a multiple-part signature operation, returning the signature * @returns The signature value */ final(): Buffer; /** * Signs (encrypts with private key) data in a single part * @param data The data to be signed * @returns Signature value */ once(data: types.CryptoData): Buffer; /** * Signs (encrypts with private key) data in a single part * @param data The data to be signed * @param cb Async callback function with signature value */ once(data: types.CryptoData, cb: (error: Error, data: Buffer) => void): void; /** * initializes a signature (private key encryption) operation * @param alg The signing mechanism * @param key The signing key */ protected init(alg: mech.MechanismType, key: Key): void; }