|
@ -10,8 +10,15 @@ class EthereumIdentityProvider { |
|
|
async getId () { return this.id; } |
|
|
async getId () { return this.id; } |
|
|
|
|
|
|
|
|
async signIdentity (data) { |
|
|
async signIdentity (data) { |
|
|
|
|
|
while(true){ //Insist (e.g. if user dismisses dialog)
|
|
|
|
|
|
try{ |
|
|
return await web3.eth.personal.sign(data, this.id,""); //Password not required for MetaMask
|
|
|
return await web3.eth.personal.sign(data, this.id,""); //Password not required for MetaMask
|
|
|
} |
|
|
} |
|
|
|
|
|
catch (e) { |
|
|
|
|
|
console.error("Failed to sign data."); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static async verifyIdentity (identity) { |
|
|
static async verifyIdentity (identity) { |
|
|
// Verify that identity was signed by the ID
|
|
|
// Verify that identity was signed by the ID
|
|
|