UNPKG

@syncfusion/ej2-pdf

Version:

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

115 lines (114 loc) 3.21 kB
import { _PdfPublicKeyCryptographyCertificate } from './pdf-cryptography-certificate'; import { _PdfX509Certificate } from './x509/x509-certificate'; import { _PdfX509Name } from './x509/x509-name'; /** * High-level certificate wrapper providing convenient accessors and loaders. * * @private */ export declare class _PdfCertificate { /** * Certificate version number. * * @private * @type {number} */ _version: number; /** * Certificate serial number bytes. * * @private * @type {Uint8Array} */ _serialNumber: Uint8Array; /** * Issuer distinguished name string. * * @private * @type {string} */ _issuerName: string; /** * Subject distinguished name string. * * @private * @type {string} */ _subjectName: string; /** * Length in bytes of the signature (if known). * * @private * @type {number} */ _signatureLength: number; /** * Certificate validity end date. * * @private * @type {Date} */ _validTo: Date; /** * Certificate validity start date. * * @private * @type {Date} */ _validFrom: Date; /** * Optional PKCS#12 / PKCS#7 wrapper when loaded from such formats. * * @private * @type {_PdfPublicKeyCryptographyCertificate} */ _publicKeyCryptographyCertificate: _PdfPublicKeyCryptographyCertificate; /** * True when this instance was initialized from a PKCS container. * * @private * @type {boolean} */ _isPublicKeyCryptographyCertificate: boolean; /** * Chain of parsed X.509 certificate objects. * * @private * @type {_PdfX509Certificate[]} */ _chains: _PdfX509Certificate[]; /** * Common OID -> attribute short-name mapping used when extracting names. * * @private * @type {Record<string,string>} */ _objectIdentifierToAttributeMap: Record<string, string>; constructor(certificate: Uint8Array | _PdfX509Certificate, password?: string); /** * Initialize from PKCS#12/PKCS#7 container bytes using the provided password. * * @private * @param {Uint8Array} certificateBytes - PKCS container bytes. * @param {string} password - Password used to decrypt the container. * @returns {void} */ _initializePublicKeyCryptographyCertificate(certificateBytes: Uint8Array, password: string): void; /** * Populate wrapper fields from a parsed `_PdfX509Certificate` instance. * * @private * @param {_PdfX509Certificate} certificate - Parsed X.509 certificate. * @returns {void} */ _loadDetailsFromCertificate(certificate: _PdfX509Certificate): void; /** * Extract a single attribute value (e.g., CN) from an `_PdfX509Name` instance. * * @private * @param {_PdfX509Name} x509Name - Parsed distinguished name. * @param {string} attribute - Attribute short name or OID to look up. * @returns {string} The attribute value or empty string when not present. */ _getUniqueAttributes(x509Name: _PdfX509Name, attribute: string): string; }