import { PowerAuthCryptogram } from "../model/PowerAuthEncryptor"; import { PowerAuthEncryptionHttpHeader } from "../model/PowerAuthEncryptionHttpHeader"; /** * Data returned from encryptRequest() function. */ export interface EncryptedRequestData { /** * Cryptogram that must be set to request body. */ cryptogram: PowerAuthCryptogram; /** * HTTP header indicating the encryption. */ header: PowerAuthEncryptionHttpHeader; /** * Identifier of newly created native object that is capable * to decrypt the response. */ decryptorId: string; } /** * Encryptor interface implemented in the native code. */ export interface PowerAuthEncryptorIfc { /** * Create native encryptor and return identifier of the underlying native object. * @param scope Scope of the encryptor. * @param ownerId Instance identifier of parent PowerAuth class. * @param autoreleaseTime Defines autorelease timeout in milliseconds. The value is used only for the testing purposes, and is ignored in the release build of library. * @returns Native object identifier. */ initialize(scope: string, ownerId: string, autoreleaseTime: number): Promise; /** * Release underlying object manually. * @param encryptorId Native object identifier. */ release(encryptorId: string): Promise; /** * Test whether encryptor supports encryption. * @param encryptorId Native object identifier. */ canEncryptRequest(encryptorId: string): Promise; /** * Encrypt request body and return data containing all information for the request construction. * @param encryptorId Native object identifier. * @param data Data to encrypt. * @param format Data encoding. See `PowerAuthDataFormat` type for options. */ encryptRequest(encryptorId: string, data: string | undefined, format: string | undefined): Promise; /** * Test whether encryptor supports response decryption. * @param encryptorId Native object identifier. */ canDecryptResponse(encryptorId: string): Promise; /** * Decrypt response cryptogram. * @param encryptorId Native object identifier. * @param cryptogram Cryptogram to decrypt. * @param outputFormat Data encoding. See `PowerAuthDataFormat` type for options. */ decryptResponse(encryptorId: string, cryptogram: PowerAuthCryptogram, outputFormat: string | undefined): Promise; } export declare const NativeEncryptor: PowerAuthEncryptorIfc;