1.0.231 • Published 4 years ago

icc-api v1.0.231

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years 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'
1.0.231

4 years ago

1.0.230

4 years ago

1.0.229

4 years ago

1.0.228

4 years ago

1.0.227

4 years ago

1.0.226

4 years ago

1.0.225

4 years ago

1.0.224

4 years ago

1.0.222

4 years ago

1.0.223

4 years ago

1.0.221

4 years ago

1.0.220

4 years ago

1.0.219

4 years ago

1.0.218

4 years ago

1.0.217

4 years ago

1.0.216

4 years ago

1.0.215

4 years ago

1.0.214

4 years ago

1.0.213

4 years ago

1.0.212

4 years ago

1.0.211

4 years ago

1.0.210

4 years ago

1.0.208

4 years ago

1.0.209

4 years ago

1.0.207

4 years ago

1.0.206

4 years ago

1.0.205

4 years ago

1.0.204

4 years ago

1.0.203

4 years ago

1.0.202

4 years ago

1.0.200

4 years ago

1.0.199

4 years ago

1.0.198

4 years ago

1.0.197

4 years ago

1.0.196

4 years ago

1.0.195

4 years ago

1.0.194

4 years ago

1.0.193

4 years ago

1.0.192

4 years ago

1.0.191

4 years ago

1.0.190

5 years ago

1.0.189

5 years ago

1.0.188

5 years ago

1.0.187

5 years ago

1.0.186

5 years ago

1.0.185

5 years ago

1.0.184

5 years ago

1.0.183

5 years ago

1.0.181

5 years ago

1.0.180

5 years ago

1.0.179

5 years ago

1.0.177

5 years ago

1.0.176

5 years ago

1.0.175

5 years ago

1.0.174

5 years ago

1.0.173

5 years ago

1.0.172

5 years ago

1.0.171

5 years ago

1.0.170

5 years ago

1.0.169

5 years ago

1.0.168

5 years ago

1.0.167

5 years ago

1.0.166

5 years ago

1.0.165

5 years ago

1.0.164

5 years ago

1.0.162

5 years ago

1.0.161

5 years ago

1.0.160

5 years ago

1.0.159

5 years ago

1.0.158

5 years ago

1.0.157

5 years ago

1.0.156

5 years ago

1.0.155

5 years ago

1.0.154

5 years ago

1.0.153

5 years ago

1.0.152

5 years ago

1.0.151

5 years ago

1.0.150

5 years ago

1.0.149

5 years ago

1.0.148

5 years ago

1.0.147

5 years ago

1.0.146

5 years ago

1.0.145

5 years ago

1.0.144

5 years ago

1.0.143

5 years ago

1.0.142

5 years ago

1.0.141

5 years ago

1.0.140

5 years ago

1.0.139

5 years ago

1.0.138

5 years ago

1.0.136

5 years ago

1.0.134

5 years ago

1.0.133

5 years ago

1.0.132

5 years ago

1.0.131

5 years ago

1.0.130

5 years ago

1.0.129

5 years ago

1.0.128

5 years ago

1.0.127

5 years ago

1.0.126

5 years ago

1.0.125

5 years ago

1.0.124

5 years ago

1.0.123

5 years ago

1.0.122

5 years ago

1.0.121

5 years ago

1.0.120

5 years ago

1.0.119

5 years ago

1.0.118

5 years ago

1.0.117

5 years ago

1.0.116

5 years ago

1.0.114

5 years ago

1.0.113

5 years ago

1.0.112

5 years ago

1.0.111

5 years ago

1.0.110

5 years ago

1.0.109

5 years ago

1.0.108

5 years ago

1.0.107

5 years ago

1.0.106

5 years ago

1.0.105

5 years ago

1.0.104

5 years ago

1.0.102

5 years ago

1.0.101

5 years ago

1.0.100

5 years ago

1.0.99

5 years ago

1.0.98

5 years ago

1.0.97

5 years ago

1.0.96

5 years ago

1.0.95

5 years ago

1.0.94

5 years ago

1.0.93

5 years ago

1.0.92

5 years ago

1.0.91

5 years ago

1.0.90

5 years ago

1.0.89

5 years ago

1.0.88

5 years ago

1.0.87

5 years ago

1.0.86

5 years ago

1.0.85

5 years ago

1.0.84

5 years ago

1.0.82

5 years ago

1.0.81

5 years ago

1.0.80

5 years ago

1.0.79

5 years ago

1.0.78

5 years ago

1.0.77

5 years ago

1.0.76

5 years ago

1.0.75

5 years ago

1.0.74

5 years ago

1.0.73

5 years ago

1.0.71

5 years ago

1.0.69

5 years ago

1.0.68

5 years ago

1.0.67

5 years ago

1.0.66

5 years ago

1.0.65

5 years ago

1.0.64

5 years ago

1.0.63

6 years ago

1.0.62

6 years ago

1.0.61

6 years ago

1.0.60

6 years ago

1.0.59

6 years ago

1.0.58

6 years ago

1.0.57

6 years ago

1.0.56

6 years ago

1.0.55

6 years ago

1.0.54

6 years ago

1.0.53

6 years ago

1.0.52

6 years ago

1.0.51

6 years ago

1.0.50

6 years ago

1.0.49

6 years ago

1.0.47

6 years ago

1.0.46

6 years ago

1.0.44

6 years ago

1.0.43

6 years ago

1.0.42

6 years ago

1.0.41

6 years ago

1.0.40

6 years ago

1.0.39

6 years ago

1.0.38

6 years ago

1.0.37

6 years ago

1.0.35

6 years ago

1.0.34

6 years ago

1.0.33

6 years ago

1.0.32

6 years ago

1.0.31

6 years ago

1.0.30

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

1.0.0-beta1

6 years ago

1.0.0-beta

6 years ago