### Hierarchy

- ProfileManagerImpl

### Implements

- ProfileManager

## Index

### Constructors

- constructor

### Methods

- decryptMessage
- downloadFile
- encryptMessage
- getAuthorizedData
- getAuthorizedEncryptionKeys
- getData
- getFileMetaWithGivenKey
- getRawData
- signMessage
- updateData
- uploadFile

## Constructors

### constructor

- new ProfileManagerImpl(clientRepository: ClientDataRepository, authAccountBehavior: Observable<Account>, encrypt: MessageEncrypt, decrypt: MessageDecrypt, signer: MessageSigner, loggerService?: Logger): ProfileManagerImpl

- - Defined in manager/ProfileManagerImpl.ts:20

  #### Parameters

  - ##### clientRepository: ClientDataRepository

  - ##### authAccountBehavior: Observable<Account>

  - ##### encrypt: MessageEncrypt

  - ##### decrypt: MessageDecrypt

  - ##### signer: MessageSigner

  - ##### Optional loggerService: Logger

  #### Returns ProfileManagerImpl

## Methods

### decryptMessage

- decryptMessage(senderPk: string, encryptedMessage: string): Promise<string>

- Implementation of ProfileManager.decryptMessage

  - Defined in manager/ProfileManagerImpl.ts:50

  #### Parameters

  - ##### senderPk: string

  - ##### encryptedMessage: string

  #### Returns Promise<string>

### downloadFile

- downloadFile(id: number, key: string, publicKey?: string, existedPassword?: string): Promise<string>

- Implementation of ProfileManager.downloadFile

  - Defined in manager/ProfileManagerImpl.ts:174

  Returns decrypted Base64 data of the authorized user based on provided file id.

  #### Parameters

  - ##### id: number

    not encrypted file id.

  - ##### key: string

    the key of FileMeta value in profile data.

  - ##### Optional publicKey: string

    the public key (id) of user. Optional. default will used origin user.

  - ##### Optional existedPassword: string

    optional if you already have password for file. apply password instead auto-generation password.

  #### Returns Promise<string>

  decrypted file Base64 data.

### encryptMessage

- encryptMessage(recipientPk: string, message: string): Promise<string>

- Implementation of ProfileManager.encryptMessage

  - Defined in manager/ProfileManagerImpl.ts:54

  #### Parameters

  - ##### recipientPk: string

  - ##### message: string

  #### Returns Promise<string>

### getAuthorizedData

- getAuthorizedData(recipientPk: string, encryptedData: string): Promise<Map<string, string>>

- Implementation of ProfileManager.getAuthorizedData

  - Defined in manager/ProfileManagerImpl.ts:103

  Decrypts accepted personal data {@link DataRequest#responseData}.

  #### Parameters

  - ##### recipientPk: string

    Public key of the user that shared the data

  - ##### encryptedData: string

    encrypted data {@link DataRequest#responseData}.

  #### Returns Promise<Map<string, string>>

  Map key => value.

### getAuthorizedEncryptionKeys

- getAuthorizedEncryptionKeys(recipientPk: string, encryptedData: string): Promise<Map<string, string>>

- Implementation of ProfileManager.getAuthorizedEncryptionKeys

  - Defined in manager/ProfileManagerImpl.ts:120

  Returns decryption keys for approved personal data {@link DataRequest#responseData}.

  #### Parameters

  - ##### recipientPk: string

    Public key of the user that shared the data

  - ##### encryptedData: string

    encrypted data {@link DataRequest#responseData}.

  #### Returns Promise<Map<string, string>>

  Map key (fieldName) => value (Password).

### getData

- getData(fieldKey?: string | Array<string>): Promise<Map<string, string>>

- Implementation of ProfileManager.getData

  - Defined in manager/ProfileManagerImpl.ts:65

  Returns decrypted data of the authorized user.

  #### Parameters

  - ##### Optional fieldKey: string | Array<string>

    is optional argument. get only requested keys.

  #### Returns Promise<Map<string, string>>

  Map key => value.

### getFileMetaWithGivenKey

- getFileMetaWithGivenKey(key: string): Promise<FileMeta | undefined>

- Implementation of ProfileManager.getFileMetaWithGivenKey

  - Defined in manager/ProfileManagerImpl.ts:181

  #### Parameters

  - ##### key: string

  #### Returns Promise<FileMeta | undefined>

### getRawData

- getRawData(anyPublicKey: string, fieldKey?: string | Array<string>): Promise<Map<string, string>>

- Implementation of ProfileManager.getRawData

  - Defined in manager/ProfileManagerImpl.ts:89

  Returns raw (encrypted) data of user with provided ID (Public Key).

  #### Parameters

  - ##### anyPublicKey: string

    Public key of client.

  - ##### Optional fieldKey: string | Array<string>

    is optional argument. get only requested keys.

  #### Returns Promise<Map<string, string>>

  Map key => value.

### signMessage

- signMessage(data: string): Promise<string>

- Implementation of ProfileManager.signMessage

  - Defined in manager/ProfileManagerImpl.ts:46

  #### Parameters

  - ##### data: string

  #### Returns Promise<string>

### updateData

- updateData(data: Map<string, string>): Promise<Map<string, string>>

- Implementation of ProfileManager.updateData

  - Defined in manager/ProfileManagerImpl.ts:137

  Encrypts and stores personal data in BASE.

  #### Parameters

  - ##### data: Map<string, string>

    not encrypted data e.g. Map {"name": "Adam"} etc.

  #### Returns Promise<Map<string, string>>

  Map with encrypted data.

### uploadFile

- uploadFile(file: FileMeta, key: string): Promise<FileMeta>

- Implementation of ProfileManager.uploadFile

  - Defined in manager/ProfileManagerImpl.ts:152

  Encrypts and stores file in BASE.

  #### Parameters

  - ##### file: FileMeta

    the actual file data encoded to Base64.

  - ##### key: string

    the key of FileMeta value in profile data. If the fileId is undefined, creates a new file, added associated FileMeta to Profile data with the key and returns FileMeta. If not then updates the existing file and its FileMeta in Profile data and returns updated FileMeta

  #### Returns Promise<FileMeta>

  Encrypted FileMeta.

Generated using TypeDoc