@0xsequence/tee-verifier
Version:
A library for verifying TEE enclave attestation
45 lines • 1.49 kB
TypeScript
import { Certificate } from 'pkijs';
export interface AttestationVerifyOptions {
rootCertFingerprint?: string;
checkDate?: Date;
expectedPCRs?: Map<number, string | string[]>;
verifyRootOfTrust?: boolean;
verifySignature?: boolean;
verifyNonce?: boolean;
verifyContentHash?: boolean;
fetch?: typeof window.fetch;
logTiming?: boolean;
}
export declare function createAttestationVerifyingFetch(options?: AttestationVerifyOptions): typeof window.fetch;
export declare class Attestation {
private readonly raw;
readonly cert: Certificate;
readonly intermediates: Certificate[];
readonly rootCert: Certificate;
readonly pcrs: Map<number, string>;
constructor(raw: RawAttestation);
get nonce(): string;
get userData(): string;
verifyRootOfTrust(checkDate?: Date): Promise<boolean>;
rootCertFingerprint(): Promise<string>;
}
type COSESign1 = Array<Uint8Array>;
export declare class SignedAttestation extends Attestation {
readonly sign1: COSESign1;
constructor(raw: RawAttestation, sign1: COSESign1);
static fromDocument(document: string): SignedAttestation;
verifySignature(): Promise<boolean>;
}
type RawAttestation = {
cabundle: Uint8Array[];
certificate: Uint8Array;
digest: string;
module_id: string;
nonce: Uint8Array;
pcrs: Map<number, Uint8Array>;
public_key: Uint8Array;
timestamp: number;
user_data: Uint8Array;
};
export {};
//# sourceMappingURL=index.d.ts.map