import * as pkcs11 from "pkcs11js"; import * as core from "../core"; import { MechanismType } from "../mech"; import { Session } from "../session"; import { Key } from '../objects'; /** * Represents decryption operation */ export declare class Decipher extends core.BaseObject { /** * Session */ protected session: Session; /** * Block size */ protected blockSize: number; /** * Creates a new instance of {@link Decipher} * @param session Session * @param alg The decryption mechanism * @param key The decryption key * @param blockSize Block size * @param lib PKCS#11 library */ constructor(session: Session, alg: MechanismType, key: Key, blockSize: number, lib: pkcs11.PKCS11); /** * Continues a multiple-part decryption operation * @param data Encrypted data * @returns Decrypted block */ update(data: Buffer): Buffer; /** * Finishes a multiple-part decryption operation * @returns Final decrypted block */ final(): Buffer; /** * Decrypts encrypted data in a single part * @param data Encrypted data * @param dec Allocated buffer for decrypted data * @returns Decrypted data */ once(data: Buffer, dec: Buffer): Buffer; /** * Decrypts encrypted data in a single part * @param data Encrypted data * @param dec Allocated buffer for decrypted data * @param cb Async callback function with decrypted data */ once(data: Buffer, dec: Buffer, cb: (error: Error, data: Buffer) => void): void; /** * Initializes a decryption operation * @param alg The decryption mechanism * @param key The decryption key */ protected init(alg: MechanismType, key: Key): void; }