import { EntityShareRequest } from '../../icc-api/model/requests/EntityShareRequest'; import { IccDataOwnerXApi } from '../icc-data-owner-x-api'; import { UserEncryptionKeysManager } from './UserEncryptionKeysManager'; import { CryptoStrategies } from './CryptoStrategies'; import { EncryptedEntityWithType, EntityWithDelegationTypeName } from '../utils/EntityWithDelegationTypeName'; import { ExchangeDataManager } from './ExchangeDataManager'; import { SecureDelegationsEncryption } from './SecureDelegationsEncryption'; import { CryptoPrimitives } from './CryptoPrimitives'; import { AccessControlSecretUtils } from './AccessControlSecretUtils'; import { EntityShareOrMetadataUpdateRequest } from '../../icc-api/model/requests/EntityShareOrMetadataUpdateRequest'; import { EncryptedEntity } from '../../icc-api/model/models'; import { SecureDelegation } from '../../icc-api/model/SecureDelegation'; import { ExchangeDataMapManager } from './ExchangeDataMapManager'; export declare class SecureDelegationsManager { private readonly exchangeDataManager; private readonly exchangeDataMapManager; private readonly secureDelegationsEncryption; private readonly accessControlSecretUtils; private readonly userKeys; private readonly primitives; private readonly dataOwnerApi; private readonly cryptoStrategies; private readonly selfNeedsAnonymousDelegations; constructor(exchangeDataManager: ExchangeDataManager, exchangeDataMapManager: ExchangeDataMapManager, secureDelegationsEncryption: SecureDelegationsEncryption, accessControlSecretUtils: AccessControlSecretUtils, userKeys: UserEncryptionKeysManager, primitives: CryptoPrimitives, dataOwnerApi: IccDataOwnerXApi, cryptoStrategies: CryptoStrategies, selfNeedsAnonymousDelegations: boolean); private readonly dataOwnerInfoCache; /** * Note: this method does not save the updated entity. * @param entity an entity, must already have secret foreign keys initialised. * @param entityType the type of the entity * @param secretIds the initial secret ids to include and share with the auto-delegations * @param owningEntityIds the initial owning entity ids to include and share with the auto-delegations * @param encryptionKeys the initial encryption keys to include and share with the auto-delegations * @param autoDelegations the data owners which will initially have access to the entity in addition to the current data owner and the access level * they will have on the entity. * @param alternateRootDelegation by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible, * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation. * @return the entity with the security metadata initialised for the provided parameters. */ entityWithInitialisedEncryptedMetadata(entity: T & { secretForeignKeys: string[]; }, entityType: EntityWithDelegationTypeName, secretIds: string[], owningEntityIds: string[], encryptionKeys: string[], autoDelegations: { [delegateId: string]: SecureDelegation.AccessLevelEnum; }, alternateRootDelegation: string | undefined): Promise; /** * Make a request for sharing an entity with a delegate or to update existing shared metadata by adding additional secretIds, encryptionKeys or * owningEntityIds if there is already some metadata shared between the current data owner and the delegate. In case there is already a delegation * for the delegate, and it already contains all the provided metadata, this method returns undefined, since there is no need to make any request to * share the provided data. * @param entityWithType an entity with type * @param delegateId the id of the delegate * @param shareSecretIds the secret ids to share * @param shareEncryptionKeys the encryption keys to share * @param shareOwningEntityIds the owning entity ids to share * @param newDelegationPermissions the permissions to grant to the delegate in case a new delegation needs to be created. If this method creates an * update request instead of a share request, this parameter is ignored. * @return the request to share the entity, or the request to update the shared metadata for the entity, or undefined if there is no need to update * the entity to allow the delegate to access the provided data. */ makeShareOrUpdateRequestParams(entityWithType: EncryptedEntityWithType, delegateId: string, shareSecretIds: string[], shareEncryptionKeys: string[], shareOwningEntityIds: string[], newDelegationPermissions: EntityShareRequest.RequestedPermissionInternal): Promise; private makeUpdateRequestParams; private makeShareRequestParams; private makeSecureDelegationInfo; private makeSecureDelegationEncryptedData; private makeExchangeDataIdInfoForDelegate; private makeExchangeDataIdInfoForSelf; private getDataOwnerInfo; }