Research Article

BSSPD: A Blockchain-Based Security Sharing Scheme for Personal Data with Fine-Grained Access Control

Algorithm 7

SetSK.
Input: account, sk
Output: bool
1 ifmsg.sender is not _selfthen
2 throw;
3 else
4 u=ua_idx.find(account);
5 ifu!=nullthen
6  u.SK=sk
7  ua_idx.modify(u)
8  return true;
9 else
10  u.A=account;
11  u.SK=sk;
12  ua_idx.emplace(u)
13  return true;
14 end
15 end