UNPKG

@credo-ts/core

Version:

<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1

43 lines • 1.47 kB
//#region src/utils/IntegrityVerifier.d.ts /** * Verifies Subresource Integrity (SRI) metadata according to W3C specification. * * This class implements the verification logic for integrity metadata strings * as defined in the W3C Subresource Integrity specification. * * @see https://www.w3.org/TR/SRI/ */ export declare class IntegrityVerifier { /** * Verifies the integrity of raw data against provided integrity metadata. * * @param data - The data to verify * @param integrityMetadata - The integrity metadata string (e.g., "sha256-...") * @throws {CredoError} if verification fails */ static verifyIntegrity(data: Uint8Array, integrityMetadata: string): void; /** * Parses integrity metadata string into structured format. * * @param metadata - The integrity metadata string * @returns Array of parsed metadata objects */ private static parseIntegrityMetadata; /** * Returns the metadata for the strongest algorithm(s) in the set. * * @param metadataSet - Array of parsed metadata * @returns Array containing only the strongest algorithm's metadata */ private static getStrongestMetadata; /** * Applies the specified hash algorithm to the given bytes. * * @param bytes - The bytes to hash * @param algorithm - The hash algorithm name * @returns Base64-encoded hash value */ private static applyAlgorithmToBytes; } //#endregion //# sourceMappingURL=IntegrityVerifier.d.mts.map