UNPKG

@syncfusion/ej2-pdf

Version:

Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.

75 lines (74 loc) 2.96 kB
import { _PdfCipherParameter } from '../x509/x509-cipher-handler'; import { _ICipherBlock } from './pdf-interfaces'; /** * Provides the internal PKCS#1 v1.5 padding wrapper around a block cipher, * exposing RSA style input/output block sizing and processing. * * @private */ export declare class _PdfCryptographicEncoding implements _ICipherBlock { private _cipher; private _isEncryption; private _isPrivateKey; constructor(cipher: _ICipherBlock); /** * Gets the algorithm name with PKCS#1 padding suffix. * * @private * @returns {string} The algorithm name in the form "<cipher>/PKCS1Padding". */ _getAlgorithmName(): string; /** * Gets the maximum input block size in bytes for the current mode with PKCS#1 padding. * * @private * @returns {number} The input block size in bytes. */ _getInputBlock(): number; /** * Gets the maximum output block size in bytes for the current mode with PKCS#1 padding. * * @private * @returns {number} The output block size in bytes. */ _getOutputBlock(): number; /** * Initializes the cryptographic encoding with the specified mode and key parameters. * * @private * @param {boolean} forEncryption Specifies whether to operate in encryption mode. * @param {_PdfCipherParameter} parameters The cipher parameters. * @returns {void} nothing. */ _initialize(forEncryption: boolean, parameters: _PdfCipherParameter): void; /** * Processes a single block by applying PKCS#1 padding (on encrypt) or removing it (on decrypt). * * @private * @param {Uint8Array} input The input buffer containing the block. * @param {number} inOff The start index within the input buffer. * @param {number} length The number of bytes to process. * @returns {Uint8Array} The uintarray returns. */ _processBlock(input: Uint8Array, inOff: number, length: number): Uint8Array; /** * Encodes (pads) a block using PKCS#1 v1.5 padding rules. * * @private * @param {Uint8Array} input The plaintext input buffer. * @param {number} inOff The start index within the input buffer. * @param {number} inLen The number of bytes to read from the input buffer. * @returns {Uint8Array} The padded block ready for RSA processing. */ _encodeBlock(input: Uint8Array, inOff: number, inLen: number): Uint8Array; /** * Decodes (unpads) a block using PKCS#1 v1.5 padding rules and validates its structure. * * @private * @param {Uint8Array} input The ciphertext input buffer. * @param {number} inOff The start index within the input buffer. * @param {number} inLen The number of bytes to read from the input buffer. * @returns {Uint8Array} The recovered message bytes after removing padding. */ _decodeBlock(input: Uint8Array, inOff: number, inLen: number): Uint8Array; }