//#region src/pptx/core/utils/signature-constants.d.ts /** * Constants for OOXML digital signature processing. * * OPC URIs, algorithm URIs, digest mappings, and enterprise * environment variable names used across both platform-agnostic * and Node-only signature modules. */ /** The OOXML relationship type for the digital signature origin part. */ declare const DIGITAL_SIGNATURE_ORIGIN_REL_TYPE = "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin"; /** The OOXML relationship type for individual signature parts. */ declare const DIGITAL_SIGNATURE_REL_TYPE = "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature"; /** Custom pptx-viewer manifest namespace for extended signature references. */ declare const PPTX_VIEWER_MANIFEST_NS = "urn:pptx-viewer:ooxml-signature:v1"; /** W3C XML Digital Signature namespace. */ declare const XMLDSIG_NS = "http://www.w3.org/2000/09/xmldsig#"; /** OPC relationship transform algorithm URI. */ declare const OPC_RELATIONSHIP_TRANSFORM = "http://schemas.openxmlformats.org/package/2006/RelationshipTransform"; /** Enveloped signature transform algorithm URI. */ declare const XML_TRANSFORM_ENVELOPED_SIGNATURE = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"; /** Set of supported XML canonicalization transform algorithm URIs. */ declare const SUPPORTED_XML_CANON_TRANSFORMS: Set; /** Environment variable: path to file containing enterprise trust root PEM certificates. */ declare const ENTERPRISE_TRUST_ROOTS_FILE_ENV = "PPTX_VIEWER_TRUST_ROOTS_FILE"; /** Environment variable: inline PEM trust roots. */ declare const ENTERPRISE_TRUST_ROOTS_PEM_ENV = "PPTX_VIEWER_TRUST_ROOTS_PEM"; /** Environment variable: require revocation check. */ declare const ENTERPRISE_REQUIRE_REVOCATION_ENV = "PPTX_VIEWER_REQUIRE_REVOCATION_CHECK"; /** Environment variable: fail on unknown revocation status. */ declare const ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV = "PPTX_VIEWER_FAIL_ON_REVOCATION_UNKNOWN"; /** Environment variable: require timestamp authority. */ declare const ENTERPRISE_REQUIRE_TIMESTAMP_ENV = "PPTX_VIEWER_REQUIRE_TIMESTAMP"; /** * Mapping from XML Digital Signature digest algorithm URIs to hash function names. * Used by Node-only code with `node:crypto` (lowercase names). */ declare const DIGEST_ALGORITHM_TO_HASH: Record; /** * Mapping from XML Digital Signature digest algorithm URIs to Web Crypto algorithm names. * Used by platform-agnostic code with `crypto.subtle.digest`. */ declare const DIGEST_ALGORITHM_TO_WEB_CRYPTO: Record; //#endregion //#region src/pptx/core/utils/signature-types.d.ts /** * Rich types for digital signature inspection, signing, and PKI validation. * * These are platform-agnostic — used by both browser-level detection * and Node-only full verification modules. */ type CertificateRevocationStatus = 'good' | 'revoked' | 'unknown' | 'not-checked' | 'error'; type TimestampAuthorityStatus = 'valid' | 'invalid' | 'not-present' | 'not-checked' | 'error' | 'untrusted'; interface SignatureReferenceCheck { uri: string; resolvedPartPath?: string; existsInPackage: boolean; digestAlgorithm?: string; digestExpectedBase64?: string; digestActualBase64?: string; digestStatus: 'verified' | 'mismatch' | 'missing-part' | 'unsupported-transform' | 'unsupported-algorithm' | 'insufficient-data'; transformAlgorithms: string[]; } interface SignatureCertificateInfo { subject?: string; issuer?: string; serialNumber?: string; validFrom?: string; validTo?: string; } type SignatureDetailStatus = 'verified' | 'digest-mismatch' | 'reference-missing' | 'signature-invalid' | 'certificate-untrusted' | 'certificate-revoked' | 'timestamp-invalid' | 'timestamp-untrusted' | 'structural-only'; interface SignatureDetail { path: string; signatureMethod?: string; canonicalizationMethod?: string; signingTime?: string; referenceCount: number; missingPartReferences: string[]; unsupportedTransforms: string[]; referenceChecks: SignatureReferenceCheck[]; certificate?: SignatureCertificateInfo; signatureValueStatus: 'verified' | 'invalid' | 'not-checked'; certificateTrustStatus: 'trusted' | 'untrusted' | 'not-checked'; certificateTrustError?: string; certificateRevocationStatus: CertificateRevocationStatus; certificateRevocationError?: string; timestampAuthorityStatus: TimestampAuthorityStatus; timestampAuthorityError?: string; certificateFingerprintSha256?: string; status: SignatureDetailStatus; } type DigitalSignatureVerificationStatus = 'unsigned' | 'verified-trusted' | 'verified-untrusted' | 'certificate-revoked' | 'digest-mismatch' | 'reference-missing' | 'signature-invalid' | 'timestamp-invalid' | 'timestamp-untrusted' | 'present-not-verified' | 'invalid-package' | 'error'; interface DigitalSignatureReport { supported: boolean; hasSignature: boolean; signatureCount: number; signaturePaths: string[]; verificationStatus: DigitalSignatureVerificationStatus; error?: string; details?: SignatureDetail[]; hasOriginRelationship?: boolean; } interface SignOptions { certificatePath: string; certificatePassword?: string; } interface SignResult { success: boolean; signedData?: Uint8Array; report: DigitalSignatureReport; error?: string; } interface LoadedSigningMaterial { privateKeyPem: string; certificatePem: string; } interface ParsedReferenceTransform { algorithm: string; relationshipReferenceIds: string[]; } interface ReferenceTransformResult { data: Uint8Array; unsupportedAlgorithms: string[]; } interface SignatureValidationPolicy { requireRevocationCheck: boolean; failOnRevocationUnknown: boolean; requireTimestamp: boolean; } interface OfficeSignatureReference { uri: string; digestMethod: string; digestValue: string; } //#endregion //#region src/pptx/core/utils/signature-xml-utils.d.ts /** * Pure regex-based XML extraction utilities for digital signature processing. * * These functions operate on raw XML strings without requiring a DOM parser, * making them platform-agnostic (browser + Node). */ /** * Escape special characters in an XML attribute value. * Handles `&`, `<`, `>`, `"`, and `'` so the result is safe inside both * double- and single-quoted attributes. */ declare function escapeXmlAttr(value: string): string; /** * Escape special characters in XML text content. * Only `&`, `<`, and `>` need escaping outside of attribute values. */ declare function escapeXmlText(value: string): string; /** Validate that `value` only contains characters from the standard base64 alphabet. */ declare function isValidBase64(value: string): boolean; /** * Extract an attribute value from the first matching XML tag via regex. * Namespace prefixes on the tag name are supported via the pattern. */ declare function extractTagAttribute(xml: string, tagName: string, attributeName: string): string | undefined; /** * Extract the text content of the first matching tag, ignoring namespace prefixes. * Whitespace within the content is collapsed. */ declare function extractFirstTagText(xml: string, localName: string): string | undefined; /** * Extract the text content of all matching tags, ignoring namespace prefixes. * Whitespace within each match is collapsed. */ declare function extractAllTagText(xml: string, localName: string): string[]; //#endregion //#region src/pptx/core/utils/signature-reference-utils.d.ts /** * Pure string utilities for resolving digital signature reference URIs * to ZIP part paths. Platform-agnostic (no Node dependencies). */ /** Normalize a ZIP part path: convert backslashes to forward slashes and strip leading slashes. */ declare function normalizePartPath(partPath: string): string; /** * Resolve a signature reference URI to a ZIP part path. * Returns `undefined` for empty URIs, fragment-only URIs (#...), or invalid input. */ declare function resolveReferenceUriToPart(uri: string): string | undefined; //#endregion //#region src/pptx/core/utils/signature-digest.d.ts /** * Platform-agnostic digest computation using the Web Crypto API. * * Works in both browser and Node.js (18+) environments via `crypto.subtle`. */ /** * Compute a Base64-encoded digest of the given content using Web Crypto. * * @param content - The binary data to hash. * @param digestAlgorithmUri - An XML Digital Signature digest algorithm URI * (e.g. `http://www.w3.org/2001/04/xmlenc#sha256`). * @returns The Base64-encoded digest, or `undefined` if the algorithm is unsupported * or `crypto.subtle` is unavailable. */ declare function computeDigestBase64(content: Uint8Array, digestAlgorithmUri: string): Promise; //#endregion //#region src/pptx/core/utils/signature-inspection-status.d.ts /** * Compute the overall status for an individual signature detail * based on its reference checks, trust, revocation, and timestamp statuses. * * @param detail - A partial `SignatureDetail` with the fields needed for status computation. * @param policy - The validation policy controlling revocation/timestamp strictness. * @returns The computed status for this signature detail. */ declare function computeDetailStatus(detail: Pick, policy: SignatureValidationPolicy): SignatureDetailStatus; /** * Compute the overall verification status from all signature details. * * @param details - Array of signature details from all signatures in the package. * @returns The overall verification status for the report. */ declare function computeVerificationStatus(details: SignatureDetail[]): DigitalSignatureReport['verificationStatus']; //#endregion export { DIGITAL_SIGNATURE_REL_TYPE as A, XML_TRANSFORM_ENVELOPED_SIGNATURE as B, SignatureDetailStatus as C, DIGEST_ALGORITHM_TO_HASH as D, TimestampAuthorityStatus as E, ENTERPRISE_TRUST_ROOTS_PEM_ENV as F, OPC_RELATIONSHIP_TRANSFORM as I, PPTX_VIEWER_MANIFEST_NS as L, ENTERPRISE_REQUIRE_REVOCATION_ENV as M, ENTERPRISE_REQUIRE_TIMESTAMP_ENV as N, DIGEST_ALGORITHM_TO_WEB_CRYPTO as O, ENTERPRISE_TRUST_ROOTS_FILE_ENV as P, SUPPORTED_XML_CANON_TRANSFORMS as R, SignatureDetail as S, SignatureValidationPolicy as T, ParsedReferenceTransform as _, resolveReferenceUriToPart as a, SignResult as b, extractAllTagText as c, isValidBase64 as d, CertificateRevocationStatus as f, OfficeSignatureReference as g, LoadedSigningMaterial as h, normalizePartPath as i, ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV as j, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE as k, extractFirstTagText as l, DigitalSignatureVerificationStatus as m, computeVerificationStatus as n, escapeXmlAttr as o, DigitalSignatureReport as p, computeDigestBase64 as r, escapeXmlText as s, computeDetailStatus as t, extractTagAttribute as u, ReferenceTransformResult as v, SignatureReferenceCheck as w, SignatureCertificateInfo as x, SignOptions as y, XMLDSIG_NS as z }; //# sourceMappingURL=signature-inspection-status-Bh2oap7B.d.ts.map