3.0.80 • Published 4 months ago

@taktik/icc-api v3.0.80

Weekly downloads
58
License
MIT
Repository
github
Last release
4 months ago

Crypto model in iCure

Lexic

  • "ABCD" is a non encrypted key (uuid, ...)
  • {AB} is the encryption key of the pair AB, where hcParty A gives delegation to hcParty B. The encryption key is stored encrypted in the hcPartyKeys of hcParty A document (see below)
  • <ABCD>_{AB} is the key ABCD encrypted with encryption key {AB}
  • <{AB}>_{A} is the encryption key {AB} encrypted with the public key of hcParty A

The encryption keys are stored in the hcParty document that gives delegation to other user, since only the user can modify his hcParty document in CouchDB. The hcParty B needs to access the hcParty A document to decrypt (with his private key) the encryption key {AB} stored in the field hcPartyKeys.

## HCP A ##
hcPartyKeys: {
   A: [ <{AA}>_{A}, <{AA}>_{A} ]
   B: [ <{AB}>_{A}, <{AB}>_{B} ]
}

Document type relations

## Patient 1234 ##
ID: "1234"
Delegations: { A->A: <ABCD>_{AA}, A->B: <ABCD>_{AB} }
EncryptionKeys: { A->A: <DCBA>_{AA}, A->B: <DCBA>_{AB} }
## Contact 4567 ##
ID: "4567"
SecretForeignKeys: [ "ABCD" ]
CryptedForeignKeys: { A->A: <1234>_{AA}, A->B: <1234>_{AB} }
EncryptionKeys: { A->A: <EFGH>_{AA}, A->B: <EFGH>_{AB} }

The delegations of the patient document store the encrypted secretForeignKeys that you find in clear in the contact document. And allows, once decrypted, to find the contacts of a patient.

On the other side, the cryptedForeignKeys of the contact document allows, once decrypted, to find the corresponding patient document.

The encryptionKeys of a document are used to encrypt the content of the corresponding document. As for the delegations, the document encryption keys are stored encrypted with the encryption keys {AA}, {AB}, ...

The healthElement documents are linked to patient documents in the same way as the contact. This means that the healthElement documents have also SecretForeignKeys and CryptedForeignKeys, beside the encryptionKeys.

Delegations

  • Delegations === encrypted foreign key of all patient icureStoredDocument => it makes the link from a patient to a storedDocument
  • CryptedForeignKeys === encrypted patient.ID => it makes the link from a storedDocument to a patient
  • EncryptionKeys === encrypted encryptionKey (probably symmetric)

Multi profession

Contacts and delegations need to be segmented. => need to have segmented auto-delegations

Usage

Instalation

Install from npm

npm install --save icc-api

ES6 import

Example ES6 include

import * as IccApi from 'icc-api'
3.0.80

4 months ago

3.0.79

4 months ago

3.0.77

5 months ago

3.0.76

6 months ago

3.0.74

7 months ago

3.0.75

7 months ago

3.0.71

7 months ago

3.0.72

7 months ago

3.0.67

7 months ago

3.0.68

7 months ago

3.0.69

7 months ago

3.0.70

7 months ago

3.0.65

9 months ago

3.0.66

9 months ago

3.0.64

11 months ago

3.0.63

11 months ago

3.0.62

12 months ago

3.0.61

12 months ago

3.0.57

1 year ago

3.0.58

1 year ago

3.0.56

1 year ago

3.0.55

1 year ago

3.0.54

1 year ago

3.0.53

1 year ago

3.0.50

1 year ago

3.0.51

1 year ago

3.0.49

1 year ago

3.0.48

1 year ago

3.0.47

1 year ago

3.0.46

1 year ago

3.0.45

1 year ago

3.0.44

1 year ago

3.0.43

1 year ago

3.0.41

1 year ago

3.0.42

1 year ago

3.0.40

1 year ago

3.0.39

1 year ago

3.0.38

1 year ago

3.0.37

1 year ago

3.0.36

1 year ago

3.0.34

1 year ago

3.0.33

1 year ago

3.0.32

1 year ago

3.0.31

1 year ago

3.0.30

1 year ago

3.0.29

1 year ago

3.0.28

1 year ago

3.0.27

1 year ago

3.0.26

1 year ago

3.0.25

1 year ago

3.0.21

1 year ago

3.0.22

1 year ago

3.0.20

1 year ago

3.0.19

1 year ago

3.0.18

1 year ago

3.0.17

1 year ago

3.0.16

1 year ago

3.0.15

2 years ago

3.0.14

2 years ago

3.0.13

2 years ago

3.0.12

2 years ago

3.0.11

2 years ago

3.0.10

2 years ago

3.0.9

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago