### Hierarchy

- ProfileManager

### Implemented by

- ProfileManagerImpl

## Index

### Methods

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

## Methods

### decryptMessage

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

- - Defined in manager/ProfileManager.ts:11

  #### Parameters

  - ##### senderPk: string

  - ##### encryptedMessage: string

  #### Returns Promise<string>

### downloadFile

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

- - Defined in manager/ProfileManager.ts:79

  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>

- - Defined in manager/ProfileManager.ts:9

  #### Parameters

  - ##### recipientPk: string

  - ##### message: string

  #### Returns Promise<string>

### getAuthorizedData

- getAuthorizedData(acceptedRequests: Array<DataRequest>): Promise<SharedData>

- - Defined in manager/ProfileManager.ts:38

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

  #### Parameters

  - ##### acceptedRequests: Array<DataRequest>

    is array DataRequest with accepted encrypted data {@link DataRequest#responseData}.

  #### Returns Promise<SharedData>

  sharedData->FieldData-> value is client value or undefined if not let access.

### getAuthorizedEncryptionKeys

- getAuthorizedEncryptionKeys(encryptedData: Array<DataRequest>): Promise<SharedData>

- - Defined in manager/ProfileManager.ts:47

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

  #### Parameters

  - ##### encryptedData: Array<DataRequest>

    is array DataRequest with accepted encrypted data {@link DataRequest#responseData}.

  #### Returns Promise<SharedData>

  sharedData->FieldData-> value is Password.

### getData

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

- - Defined in manager/ProfileManager.ts:19

  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>

- - Defined in manager/ProfileManager.ts:86

  Returns given key's decrypted value of authorized user's data.

  #### Parameters

  - ##### key: string

  #### Returns Promise<FileMeta | undefined>

  Map key => value.

### getRawData

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

- - Defined in manager/ProfileManager.ts:28

  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>

- - Defined in manager/ProfileManager.ts:7

  #### Parameters

  - ##### data: string

  #### Returns Promise<string>

### updateData

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

- - Defined in manager/ProfileManager.ts:55

  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>

- - Defined in manager/ProfileManager.ts:67

  Encrypts and stores file in BASE.

  #### Parameters

  - ##### file: FileMeta

    the actual file information

  - ##### key: string

    the key of FileMeta value in profile data If the value of the key 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