import { KeyPair, ShaVersion } from './RSA'; import { CryptoPrimitives } from './CryptoPrimitives'; import { IccRecoveryDataApi } from '../../icc-api/api/internal/IccRecoveryDataApi'; import { RecoveryData } from '../../icc-api/model/internal/RecoveryData'; export declare enum RecoveryDataUseFailureReason { /** * The recovery data matching the provided recovery key does not exist. It could have been deleted, or it could have been expired. */ Missing = "MISSING", /** * The recovery data exists but it is not available to the current user. The user may have used a recovery key that he created while logged in as * a different user. */ Unauthorized = "UNAUTHORIZED", /** * The recovery data exists and is available to the current user, but it is not of the expected type. */ InvalidType = "INVALID_TYPE", /** * The recovery data exists and is available to the current user, but its content could not be interpreted. The data may have been created * with an unsupported SDK version. */ InvalidContent = "INVALID_CONTENT" } type ExchangeDataRecoveryDataContent = { exchangeDataId: string; rawAccessControlSecret: string; rawSharedSignatureKey: string; rawExchangeKey: string; }[]; type KeyPairRecoveryDataContent = { [delegateId: string]: { pair: KeyPair; algorithm: ShaVersion; }[]; }; type RecoveryDataContent = KeyPairRecoveryDataContent | ExchangeDataRecoveryDataContent; /** * @internal this class is for internal use only and may change without notice. */ export declare class RecoveryDataEncryption { private readonly primitives; private readonly baseRecoveryApi; constructor(primitives: CryptoPrimitives, baseRecoveryApi: IccRecoveryDataApi); recoveryKeyToId(recoveryKey: string): Promise; createAndSaveKeyPairsRecoveryDataFor(recipient: string, keyPairs: { [delegateId: string]: { pair: KeyPair; algorithm: ShaVersion; }[]; }, lifetimeSeconds: number | undefined): Promise; getAndDecryptKeyPairsRecoveryData(recoveryKey: string, autoDeleteOnSuccess: boolean): Promise<{ success: { [dataOwnerId: string]: { [publicKeySpki: string]: KeyPair; }; }; } | { failure: RecoveryDataUseFailureReason; }>; createAndSaveExchangeDataRecoveryData(recipient: string, exchangeDataInfo: { exchangeDataId: string; rawAccessControlSecret: ArrayBuffer; rawSharedSignatureKey: ArrayBuffer; rawExchangeKey: ArrayBuffer; }[], lifetimeSeconds: number | undefined): Promise; getAndDecryptExchangeDataRecoveryData(recoveryKey: string): Promise<{ success: { exchangeDataId: string; rawAccessControlSecret: ArrayBuffer; rawSharedSignatureKey: ArrayBuffer; rawExchangeKey: ArrayBuffer; }[]; } | { failure: RecoveryDataUseFailureReason; }>; getRecoveryDataAndDecrypt(recoveryKey: string, expectedType: RecoveryData.Type): Promise<{ recoveryData: RecoveryData; decryptedJson: any; } | { failure: RecoveryDataUseFailureReason; }>; createRecoveryData(recipient: string, type: RecoveryData.Type, lifetimeSeconds: number | undefined, content: RecoveryDataContent): Promise; } export {};