dcap-qvl 0.6.1

This crate implements the quote verification logic for DCAP (Data Center Attestation Primitives) in pure Rust.
Documentation
import init, { QuoteVerifier } from "/pkg/web/dcap-qvl-web.js";

// Function to fetch a file as a Uint8Array
async function fetchFileAsUint8Array(url) {
    const response = await fetch(url);
    const data = await response.arrayBuffer();
    return new Uint8Array(data);
}

// URLs to your sample files
const rawQuoteUrl = "/sample/tdx_quote";

// Load the files
async function getCollateral() {
    try {
        // Initialize the WASM module
        await init("/pkg/web/dcap-qvl-web_bg.wasm");

        const rawQuote = await fetchFileAsUint8Array(rawQuoteUrl);

        let pccs_url = "https://pccs.phala.network/tdx/certification/v4";
        const result = await QuoteVerifier.get_collateral(pccs_url, rawQuote);
        console.log("Collateral Result:", result);
    } catch (error) {
        console.error("Get collateral failed:", error);
    }
}

// Execute the verification
getCollateral();