Newer
Older
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
function Identity() {
}
Identity.prototype.set = function(obj) {
for(var member in obj) {
this[member] = JSON.parse(JSON.stringify(obj[member]))
}
};
Identity.prototype.serialize = function() {
return JSON.stringify(this)
};
Identity.prototype.deserialize = function(serialized) {
var obj = JSON.parse(serialized);
this.set(obj)
};
Identity.prototype.setAuthentication = function(cryptoData) {
this["authentication"] = cryptoData
};
Identity.prototype.getAuthentication = function() {
return this["authentication"]
};
Identity.prototype.setPinCode = function(pinCode) {
this["pinCode"] = pinCode
};
Identity.prototype.getPinCode = function() {
return this["pinCode"]
};
Identity.prototype.setPassport = function(passportUUID, cryptoData) {
if(this["passports"] === undefined || this["passports"] === null) {
this["passports"] = {}
}
this["passports"][passportUUID] = cryptoData
};
Identity.prototype.getPassport = function(passportUUID) {
if(this["passports"] === undefined || this["passports"] === null) {
this["passports"] = {}
}
return this["passports"][passportUUID]
};
export default Identity;