import { EncryptedEntityWithType } from '../utils';
import { ExchangeKeysManager } from './ExchangeKeysManager';
import { CryptoPrimitives } from './CryptoPrimitives';
import { ExchangeDataManager } from './ExchangeDataManager';
import { ExchangeDataMapManager } from './ExchangeDataMapManager';
import { SecureDelegationsEncryption } from './SecureDelegationsEncryption';
import { IccDataOwnerXApi } from '../icc-data-owner-x-api';
import { EncryptedEntity, EncryptedEntityStub, SecureDelegation } from '../../icc-api/model/models';
import AccessLevelEnum = SecureDelegation.AccessLevelEnum;
export type DelegationMembersDetails = {
    delegator: string | undefined;
    delegate: string | undefined;
    fullyExplicit: boolean;
    accessControlSecret: string | undefined;
    accessLevel: AccessLevelEnum;
};
export declare enum SecurityMetadataType {
    SecretId = 1,// Start from 1, avoids issues with SecretId being falsy
    EncryptionKey = 2,
    OwningEntityId = 3
}
export declare class SecurityMetadataDecryptor {
    private readonly exchangeKeysManager;
    private readonly primitives;
    private readonly exchangeData;
    private readonly exchangeDataMap;
    private readonly secureDelegationsEncryption;
    private readonly dataOwnerApi;
    constructor(exchangeKeysManager: ExchangeKeysManager, primitives: CryptoPrimitives, exchangeData: ExchangeDataManager, exchangeDataMap: ExchangeDataMapManager, secureDelegationsEncryption: SecureDelegationsEncryption, dataOwnerApi: IccDataOwnerXApi);
    decryptLegacyDelegations(entities: (EncryptedEntityStub | EncryptedEntity)[], dataOwnersHierarchySubset: string[], metadataType: SecurityMetadataType): Promise<{
        [entityId: string]: string[];
    }>;
    private extractFromLegacyDelegations;
    private populateLegacyDelegationDelegate;
    private tryDecryptLegacyDelegation;
    decryptSecureDelegationsUsingCache(entities: (EncryptedEntityStub | EncryptedEntity)[], dataOwnersHierarchySubset: string[], metadataType: SecurityMetadataType): Promise<{
        [entityId: string]: string[];
    }>;
    hasSecurityMetadataOfType(delegation: SecureDelegation, metadataType: SecurityMetadataType): boolean;
    decryptSecureDelegationsUsingKnownExchangeData(entities: (EncryptedEntityStub | EncryptedEntity)[], dataOwnersHierarchySubset: string[], metadataType: SecurityMetadataType): Promise<{
        [entityId: string]: string[];
    }>;
    decryptSecureDelegationsUsingExchangeDataMap(entities: (EncryptedEntityStub | EncryptedEntity)[], dataOwnersHierarchySubset: string[], metadataType: SecurityMetadataType): Promise<{
        [entityId: string]: string[];
    }>;
    decryptAll(entity: EncryptedEntityStub | EncryptedEntity, dataOwnersHierarchySubset: string[], metadataType: SecurityMetadataType): Promise<{
        ownerId: string;
        extracted: string[];
    }[]>;
    decryptAllLegacyDelegations(entity: EncryptedEntityStub | EncryptedEntity, dataOwnersHierarchySubset: string[], metadataType: SecurityMetadataType): Promise<{
        decrypted: string;
        dataOwnersWithAccess: string[];
    }[]>;
    decryptAllSecureDelegations(entity: EncryptedEntityStub | EncryptedEntity, dataOwnersHierarchySubset: string[], metadataType: SecurityMetadataType): Promise<{
        decrypted: string;
        dataOwnersWithAccess: string[];
    }[]>;
    getDelegationMemberDetails(typedEntity: EncryptedEntityWithType): Promise<{
        [delegationKey: string]: DelegationMembersDetails;
    }>;
    decryptSecureDelegationMetadata(delegation: SecureDelegation, metadataType: SecurityMetadataType, key: CryptoKey): Promise<string[]>;
    getEntityLegacyDelegationAccessLevel(entity: EncryptedEntityStub | EncryptedEntity, dataOwnersHierarchySubset: string[]): Promise<AccessLevelEnum | undefined>;
    getEntitySecureDelegationAccessLevel(entity: EncryptedEntityStub | EncryptedEntity, dataOwnersHierarchySubset: string[]): Promise<AccessLevelEnum | undefined>;
    getEntityAccessLevel(entity: EncryptedEntityStub | EncryptedEntity, dataOwnersHierarchySubset: string[]): Promise<AccessLevelEnum | undefined>;
    hasAnyEncryptionKeys(entity: EncryptedEntityStub | EncryptedEntity): boolean;
}
