Newer
Older
export interface AESGCMOutput {
data: ArrayBuffer;
key: ArrayBuffer;
iv: ArrayBuffer;
}
export interface RSAKeys {
publicKeyPEM: string;
privateKeyPEM: string;
}
encryptAESGCM: (data: string) => Promise<AESGCMOutput>;
decryptAESGCM: (data: ArrayBuffer, key: ArrayBuffer, iv: ArrayBuffer) => Promise<string>;
generateRSAKeys: () => Promise<RSAKeys>;
encryptRSA: (publicKeyPEM: string, data: ArrayBuffer) => Promise<ArrayBuffer>;
decryptRSA: (privateKeyPEM: string, data: ArrayBuffer) => Promise<ArrayBuffer>;
signRSA: (privateKeyPEM: string, data: ArrayBuffer) => Promise<ArrayBuffer>;
verifyRSASignature: (publicKeyPEM: string, data: ArrayBuffer, signature: ArrayBuffer) => Promise<boolean>;
SHA256: (string: string) => Promise<ArrayBuffer>;