import { CipherString } from '../models/domain/cipherString'; import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey'; import { ProfileOrganizationResponse } from '../models/response/profileOrganizationResponse'; import { KdfType } from '../enums/kdfType'; export abstract class CryptoService { setKey: (key: SymmetricCryptoKey) => Promise; setKeyHash: (keyHash: string) => Promise<{}>; setEncKey: (encKey: string) => Promise<{}>; setEncPrivateKey: (encPrivateKey: string) => Promise<{}>; setOrgKeys: (orgs: ProfileOrganizationResponse[]) => Promise<{}>; getKey: () => Promise; getKeyHash: () => Promise; getEncKey: () => Promise; getPublicKey: () => Promise; getPrivateKey: () => Promise; getFingerprint: (userId: string, publicKey?: ArrayBuffer) => Promise; getOrgKeys: () => Promise>; getOrgKey: (orgId: string) => Promise; hasKey: () => Promise; hasEncKey: () => Promise; clearKey: () => Promise; clearKeyHash: () => Promise; clearEncKey: (memoryOnly?: boolean) => Promise; clearKeyPair: (memoryOnly?: boolean) => Promise; clearOrgKeys: (memoryOnly?: boolean) => Promise; clearPinProtectedKey: () => Promise; clearKeys: () => Promise; toggleKey: () => Promise; makeKey: (password: string, salt: string, kdf: KdfType, kdfIterations: number) => Promise; makeShareKey: () => Promise<[CipherString, SymmetricCryptoKey]>; makeKeyPair: (key?: SymmetricCryptoKey) => Promise<[string, CipherString]>; makePinKey: (pin: string, salt: string, kdf: KdfType, kdfIterations: number) => Promise; hashPassword: (password: string, key: SymmetricCryptoKey) => Promise; makeEncKey: (key: SymmetricCryptoKey) => Promise<[SymmetricCryptoKey, CipherString]>; remakeEncKey: (key: SymmetricCryptoKey) => Promise<[SymmetricCryptoKey, CipherString]>; encrypt: (plainValue: string | ArrayBuffer, key?: SymmetricCryptoKey) => Promise; encryptToBytes: (plainValue: ArrayBuffer, key?: SymmetricCryptoKey) => Promise; rsaEncrypt: (data: ArrayBuffer, publicKey?: ArrayBuffer) => Promise; decryptToBytes: (cipherString: CipherString, key?: SymmetricCryptoKey) => Promise; decryptToUtf8: (cipherString: CipherString, key?: SymmetricCryptoKey) => Promise; decryptFromBytes: (encBuf: ArrayBuffer, key: SymmetricCryptoKey) => Promise; randomNumber: (min: number, max: number) => Promise; }