import { EncryptedFileContent } from './types'; export default class CryptoBase { /** * Generates a new keypair for encryption. * @returns The generated keypair. */ generate: () => import("./types").Keypair; /** * Encrypt given binary file with a unique keypair for each submission. * @param binary The file to encrypt, should be a blob that is converted to Uint8Array binary * @param publicKey The base-64 encoded public key * @returns Promise holding the encrypted file * @throws error if any of the encrypt methods fail */ encryptFile: (binary: Uint8Array, publicKey: string) => Promise; /** * Decrypt the given encrypted file content. * @param secretKey Secret key as a base-64 string * @param encrypted Object returned from encryptFile function * @param encrypted.submissionPublicKey The file's public key as a base-64 string * @param encrypted.nonce The nonce as a base-64 string * @param encrypted.blob The encrypted file as a Blob object */ decryptFile: (secretKey: string, { submissionPublicKey: filePublicKey, nonce, binary: encryptedBinary, }: EncryptedFileContent) => Promise; }