-
Notifications
You must be signed in to change notification settings - Fork 91
/
fpc-components.puml
209 lines (159 loc) · 4.47 KB
/
fpc-components.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/'
Copyright 2020 Intel Corporation
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
'/
@startuml
title FPC Components
top to bottom direction
package protobufs {
note "This proto message definition may be deprecated\nand replaced with proto files in `protos/fpc" as M
class CCParameters {
}
class Public_Keys {
Enclave_VK bytes
Enclave_EK bytes
}
class Private_Keys {
Enclave_SK bytes
Enclave_DK bytes
}
class AttestedData {
}
note left of AttestedData::onCreation
For semantics and motivation of this field, see
comment in createEnclave function in fpc-registration.puml.
end note
AttestedData *-down- CCParameters : contains
AttestedData *-down- Public_Keys : contains
Private_Keys *-up- Public_Keys : derives
note right of Public_Keys::Enclave_VK #FFaa00
enclave verification key, autogenerated on Create invocation
end note
note right of Public_Keys::Enclave_EK #FFaa00
enclave encryption key, autogenerated on Create invocation
end note
note right of Private_Keys::Enclave_SK #FFaa00
enclave signing key key, autogenerated on Create invocation
end note
note right of Private_Keys::Enclave_DK #FFaa00
enclave decryption key, autogenerated on Create invocation
end note
class Credentials {
}
} /' package protobufs '/
Credentials *- AttestedData : contains
package registry {
class ERCC {
- IAS_Root_Certificate string
- TLCC_MREnclave const bytes
+ ercc ERCC_Interface
}
note right of ERCC::IAS_Root_Certificate
Constant string hard-coded in ERCC's code.
It is a private member but explictly approved by orgs during installation.
end note
note right of ERCC::TLCC_MREnclave
"Full" FPC only (Post-MVP)
Constant string hard-coded in ERCC's code.
It is a private member but explictly approved by orgs during installation.
end note
interface ERCC_Admin_Interface {
+ newEnclave(Credentials)
}
interface ERCC_Client_Interface {
+ getAttestationByChaincode(CC_Id) (List<RegisterEntry>, error)
+ getAttestationByECCId(Enclave_VK) (RegisterEntry, error)
}
interface ERCC_Interface {
Admin_API ERCC_Admin_Interface
Client_API ERCC_Client_Interface
}
} /' package registry '/
ERCC_Interface *-- ERCC_Admin_Interface: contains
ERCC_Interface *-- ERCC_Client_Interface: contains
ERCC_Admin_Interface -down- protobufs: stores
ERCC_Client_Interface -down- protobufs: retrieves
package Fabric {
interface Shim {
+ get_channel_id
+ get_msp_id (of local peer in 2.0, of client in 1.4)
+ put_state
+ get_state
' * get_state_by_partial_composite_key
' * getLogger
}
interface Chaincode {
* init
* invoke
}
}
package enclave_chaincode {
class ECC {
- enclave Ecc_Enclave
- tlcc TLCC
+ invoke()
- callback_log()
- callback_getState()
- callback_putState()
}
interface ECC_Enclave_Admin {
+ Credentials create(spid)
}
interface ECC_Enclave {
- Public_Keys
- Private_Keys
- Chaincode_DK
- ecc_admin ECC_Admin
+ --init--
+ int invoke(*args, *response, max_response_len, actual_response_len, ctx)
}
interface FPCShim {
* get_channel_id
* get_msp_id (of local peer in 2.0, of client in 1.4)
+ get_state(key string, ctx CTX) bytes
+ put_state(key string, value bytes, ctx CTX) error
+ get_state_by_partial_composite_key(compKey string, ctx CTX) (List<bytes>, error)
+ log_debug(msg string)
+ log_info(msg string)
+ log_warn(msg string)
+ log_error(msg string)
- unmarshal_args()
- unmarshal_values()
}
interface FPCChaincode {
+ int invoke(*args, *response, max_response_len, actual_response_len, ctx)
}
} /' package enclave chaincode '/
package tlcc {
Note right
"Full" FPC only (Post-MVP)
end note
interface TLCC {
+ getMetadata(key string) Metadata
}
class TLCC_Enclave {
map[string]Metadata
}
class Metadata {
hash bytes
key string
signature ECDSA_Sig
}
TLCC_Enclave -down- Metadata : stores
} /' package tlcc'/
ECC .down.|> Chaincode : implements
TLCC .down.|> Chaincode : implements
ERCC .down.|> Chaincode : implements
ERCC .down.|> ERCC_Interface : implements
ECC_Enclave .down.|> FPCChaincode: implements
FPCChaincode -down-> ECC_Enclave_Admin : invoke
ECC_Enclave_Admin .down.|> protobufs: creates
ECC -down-> ECC_Enclave : invoke
ECC -down- Shim : uses
ECC --> TLCC : getMetadata
ERCC -- Shim : uses
TLCC -down- TLCC_Enclave : uses >
ECC_Enclave -down- FPCShim : uses >
FPCShim -up-> ECC : callBack
@enduml