/// <reference types="node" />
import { CpuInfo } from "../../bindings/amd-sev-snp-napi-rs/";
import { SnpCert, SevSnpCertificateFormat, SNPReport, SNPReportWithChain } from "../proto/AmdSevSnp";
export declare enum SupportedAmdSevSnpGenerations {
    Milan = "Milan",
    Genoa = "Genoa"
}
export interface CalcSnpMrEnclaveParams {
    ovmfPath: string;
    kernelHash: Buffer;
    initrdHash?: Buffer;
    cmdLineHash: Buffer;
    vcpuSig: number;
    vcpuCount: number;
    vmpl?: number;
    policy?: bigint;
}
export declare const AMD_EPYC_MILAN_CPUINFO: CpuInfo;
export declare const EMPTY_INITRD_SHA256_HASH: Buffer;
export type ArkHashes = {
    [key: string]: Buffer;
};
export declare const ARK_MILAN = "-----BEGIN CERTIFICATE-----\nMIIGYzCCBBKgAwIBAgIDAQAAMEYGCSqGSIb3DQEBCjA5oA8wDQYJYIZIAWUDBAIC\nBQChHDAaBgkqhkiG9w0BAQgwDQYJYIZIAWUDBAICBQCiAwIBMKMDAgEBMHsxFDAS\nBgNVBAsMC0VuZ2luZWVyaW5nMQswCQYDVQQGEwJVUzEUMBIGA1UEBwwLU2FudGEg\nQ2xhcmExCzAJBgNVBAgMAkNBMR8wHQYDVQQKDBZBZHZhbmNlZCBNaWNybyBEZXZp\nY2VzMRIwEAYDVQQDDAlBUkstTWlsYW4wHhcNMjAxMDIyMTcyMzA1WhcNNDUxMDIy\nMTcyMzA1WjB7MRQwEgYDVQQLDAtFbmdpbmVlcmluZzELMAkGA1UEBhMCVVMxFDAS\nBgNVBAcMC1NhbnRhIENsYXJhMQswCQYDVQQIDAJDQTEfMB0GA1UECgwWQWR2YW5j\nZWQgTWljcm8gRGV2aWNlczESMBAGA1UEAwwJQVJLLU1pbGFuMIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEA0Ld52RJOdeiJlqK2JdsVmD7FktuotWwX1fNg\nW41XY9Xz1HEhSUmhLz9Cu9DHRlvgJSNxbeYYsnJfvyjx1MfU0V5tkKiU1EesNFta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QmvH7kjlOznFx3i21SzOPDs5L\n7SgFjMC9rR07292GQCA7Z7Ulq97JQaWeD2ofGGse5swj4OQfKfVv/zaJUFjvosZO\nnfZ63epu8MjWgBSXJg5QE/Al0zRsZsp53DBTdA+Uv/s33fexdenT1mpKYzhIg/cK\ntz4oMxq8JKWJ8Po1CXLzKcfrTphjlbkh8AVKMXeBd2SpM33B1YP4g1BOdk013kqb\n7bRHZ1iB2JHG5cMKKbwRCSAAGHLTzASgDcXr9Fp7Z3liDhGu/ci1opGmkp12QNiJ\nuBbkTU+xDZHm5X8Jm99BX7NEpzlOwIVR8ClgBDyuBkBC2ljtr3ZSaUIYj2xuyWN9\n5KFY49nWxcz90CFa3Hzmy4zMQmBe9dVyls5eL5p9bkXcgRMDTbgmVZiAf4afe8DL\ndmQcYcMFQbHhgVzMiyZHGJgcCrQmA7MkTwEIds1wx/HzMcwU4qqNBAoZV7oeIIPx\ndqFXfPqHqiRlEbRDfX1TG5NFVaeByX0GyH6jzYVuezETzruaky6fp2bl2bczxPE8\nHdS38ijiJmm9vl50RGUeOAXjSuInGR4bsRufeGPB9peTa9BcBOeTWzstqTUB/F/q\naZCIZKr4X6TyfUuSDz/1JDAGl+lxdM0P9+lLaP9NahQjHCVf0zf1c1salVuGFk2w\n/wMz1R1BHg==\n-----END CERTIFICATE-----";
export declare function getDefaultArkHashes(): ArkHashes;
export declare class SevSNP {
    static serializeSNPReport(report: SNPReportWithChain): Buffer;
    static deserializeSNPReport(serialized: Buffer): SNPReportWithChain;
    protected static convertCertToPem(cert: Buffer): string;
    protected static convertPemToDer(cert: string): Buffer;
    protected static splitCerts(certsPem: string): string[];
    protected static readCmdLine(): Promise<string>;
    /**
     * Method for generation AMD SEV-SNP Report
     * @param userData - The data that will be included in the report and will be signed
     */
    static generateSNPReport(userData: Buffer): Promise<SNPReport>;
    /**
     * Method for fetch certificates from AMD KDS
     * @param report - report generated by the `generateSNPReport` method
     * @param options - options for working with HTTP, allows you to configure repetitions and the interval between them,
     *                  as well as the format of the returned certificates
     */
    static getReportChain(report: SNPReport, options?: {
        retryMax?: number;
        retryInterval?: number;
        certFormat?: SevSnpCertificateFormat;
    }): Promise<SnpCert[]>;
    /**
     * Method for generation AMD SEV-SNP Report and fetching certificates
     * @param userData - @see generateSNPReport
     * @param options - @see getReportChain
     */
    static generateSNPReportWithChain(userData: Buffer, options?: {
        retryMax?: number;
        retryInterval?: number;
        certFormat?: SevSnpCertificateFormat;
    }): Promise<SNPReportWithChain>;
    protected static runSubProcess(binaryPath: string, args?: string[], options?: {
        cwd?: string;
        timeoutMs?: number;
    }): Promise<{
        exitCode: number;
        stdout: string;
        stderr: string;
    }>;
    static getCertHash(cert: SnpCert): Buffer;
    protected static isValidArk(ARK: SnpCert, trustedHashes: ArkHashes): boolean;
    /**
     * AMD SEV-SNP verification method
     * @param report - report with full certificate chain
     * @param options - trustedHashes - map of trusted AMD ARK Certificates (CommonName as Key, Sha256 Hash of Der Certificate as Value) - optional
     *                  timeoutMs - timeout of the utility snpnost in ms
     *                  snpGuestBinaryPath - path for snpguest util
     */
    static verifyReport(report: SNPReportWithChain, options?: {
        trustedHashes?: ArkHashes;
        timeoutMs?: number;
        snpGuestBinaryPath?: string;
        tmpDirTemplate?: string;
    }): Promise<void>;
    protected static calcMrEnclave(measure: Buffer, vmpl: number, policy: bigint): Buffer;
    /**
     * Method for obtaining mrEnclave from report. MrEnclave includes report measure, report vmpl and report policy
     * @param report - report without certificates
     */
    static getMrEnclave(report: Buffer): Buffer;
    /**
     * Method for obtaining reportData. This data was passed when generating the report
     * @param report - report without certificates
     */
    static getReportData(report: Buffer): Promise<Buffer>;
    /**
     * Method for obtaining measure. Please do not confuse with mrenclave. Report measure is part of mrEnclave.
     * @param report - report without certificates
     */
    static getReportMeasure(report: Buffer): Promise<Buffer>;
    protected static calculateFileSha256(filePath: string): Promise<Buffer>;
    protected static calculateCmdlineHash(cmdLine: string): Buffer;
    /**
     * The method allows to get the expected mrEnclave without generating a report
     * @param params - @see CalcSnpMrEnclaveParams
     */
    static calcSnpMrEnclave(params: CalcSnpMrEnclaveParams): Promise<Buffer>;
    protected static extractBuildFromCmdline(cmdLine: string, paramName?: string): string;
    /**
     * Compute the 32-bit CPUID signature from family, model, and stepping.
     * This computation is described in AMD's CPUID Specification, publication #25481
     * https://www.amd.com/system/files/TechDocs/25481.pdf
     * See section: CPUID Fn0000_0001_EAX Family, Model, Stepping Identifiers
     * @param cpuInfo - Structure containing family, model and stepping @see CpuInfo
     */
    static getCpuSig(cpuInfo: CpuInfo): number;
}
