UNPKG

@syncfusion/ej2-pdf

Version:

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

92 lines (91 loc) 2.99 kB
/** * Provides internal utilities to map digest names and OIDs, resolve canonical algorithm * identifiers, and construct message digest instances for hashing. * * @private */ export declare class _PdfMessageDigestAlgorithms { /** * Internal canonical name for the SHA 1 digest. * * @private */ readonly _secureHash1: string; /** * Internal canonical name for the SHA 256 digest. * * @private */ readonly _secureHash256: string; /** * Internal canonical name for the SHA 384 digest. * * @private */ readonly _secureHash384: string; /** * Internal canonical name for the SHA 512 digest. * * @private */ readonly _secureHash512: string; private _names; private _digests; private _algorithms; constructor(); /** * Initializes the OID → digest short name map used for reverse lookups. * * @private * @returns {void} This method does not return a value. */ _initializeNameMappings(): void; /** * Initializes the digest label → OID map, accepting multiple name variants. * * @private * @returns {void} This method does not return a value. */ _initializeDigestMappings(): void; /** * Initializes the algorithm name/OID → canonical algorithm label map. * * @private * @returns {void} This method does not return a value. */ _initializeAlgorithmMappings(): void; /** * Resolves the digest short name for the specified OID; returns the input if unknown. * * @private * @param {string} id The OID string to resolve (e.g., "1.3.14.3.2.26"). * @returns {string} The resolved short name (e.g., "SHA1") or the original id if not mapped. */ _getDigest(id: string): string; /** * Resolves a digest label to its OID if allowed. * * @private * @param {string} name The digest label to resolve (e.g., "SHA-256", "sha256"). * @returns {string} The corresponding OID if found; otherwise, undefined or null. */ _getAllowedDigests(name: string): string; /** * Returns an internal message digest implementation instance for the given algorithm label. * * @private * @param {string} hashAlgorithm The requested hash algorithm label (accepts common variants). * @returns {any} The message digest instance (e.g., _Sha256, _Sha1, _Sha384, _Sha512, or RIPEMD160 evaluator). * @throws {Error} If the algorithm is invalid or unsupported. */ _getMessageDigest(hashAlgorithm: string): any; /** * Computes the digest for the given data using the requested algorithm name. * * @private * @param {Uint8Array} data The input data to hash. * @param {string} hashAlgorithm The algorithm label to use (e.g., "SHA-256"). * @returns {Uint8Array} The computed hash bytes. */ _digest(data: Uint8Array, hashAlgorithm: string): Uint8Array; }