mina-attestations
Version:
Private Attestations on Mina
38 lines (37 loc) • 1.17 kB
TypeScript
export { verifyDkim, prepareEmailForVerification, fetchPublicKeyFromDNS };
/**
* Verify DKIM signature on the given email.
*/
declare function verifyDkim(email: string): Promise<void>;
/**
* Given an email string, extracts email header and body in their
* canonicalized form and parses the DKIM configuration from the header.
*/
declare function prepareEmailForVerification(email: string): {
canonicalHeader: string;
canonicalBody: string;
canonicalDkimHeader: string;
dkimHeader: {
signAlgo: "rsa" | "ed25519";
hashAlgo: "sha256" | "sha1";
headerCanon: "simple" | "relaxed";
bodyCanon: "simple" | "relaxed";
signingDomain: string;
selector: string;
bodyHashSpec: {
algo: "sha256" | "sha1";
maxBodyLength: number | undefined;
};
bodyHash: string;
headerFields: string[];
signature: string;
};
};
declare function fetchPublicKeyFromDNS({ selector, signingDomain, }: {
selector: string;
signingDomain: string;
}): Promise<{
publicKey: CryptoKey;
publicKeyBytesDer: Uint8Array<ArrayBuffer>;
modulusLength: number;
}>;