/** * @author Jörn Heinemann * @since 2022/08/19 */ import { AbstractCrypto } from "./AbstractCrypto"; import { CryptoRawOutput, UserPublicKeyData } from "../Enities"; import { SymKey } from "./SymKey"; export declare abstract class AbstractAsymCrypto extends AbstractCrypto { /** * Fetch the public key for this user * * @param reply_id */ abstract getPublicKey(reply_id: string): Promise; /** * Get the own private key * because only the actual user got access to the private key * * @param key_id */ abstract getPrivateKey(key_id: string): Promise; abstract getPrivateKeySync(key_id: string): string; abstract getSignKey(): Promise; abstract getSignKeySync(): string; abstract getJwt(): Promise; encryptRaw(data: Uint8Array, reply_id: string): Promise; encryptRaw(data: Uint8Array, reply_id: string, sign: true): Promise; encryptRawSync(data: Uint8Array, reply_public_key: string, sign?: boolean): CryptoRawOutput; decryptRaw(head: string, encrypted_data: Uint8Array): Promise; decryptRaw(head: string, encrypted_data: Uint8Array, verify_key: string): Promise; decryptRawSync(head: string, encrypted_data: Uint8Array, verify_key?: string): Uint8Array; encrypt(data: Uint8Array, reply_id: string): Promise; encrypt(data: Uint8Array, reply_id: string, sign: true): Promise; encryptSync(data: Uint8Array, reply_public_key: string, sign?: boolean): Uint8Array; decrypt(data: Uint8Array): Promise; decrypt(data: Uint8Array, verify: boolean, user_id: string): Promise; decryptSync(data: Uint8Array, verify_key?: string): Uint8Array; encryptString(data: string, reply_id: string): Promise; encryptString(data: string, reply_id: string, sign: true): Promise; encryptStringSync(data: string, reply_public_key: string, sign?: boolean): string; decryptString(data: string): Promise; decryptString(data: string, verify: boolean, user_id: string): Promise; decryptStringSync(data: string, verify_key?: string): string; generateNonRegisteredKey(reply_id: string): Promise<[SymKey, string]>; getNonRegisteredKey(master_key_id: string, key: string): Promise; }