Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw e;
}
} finally {
console.info('wallet already exist, try to open wallet');
}
stewardWallet = await sdk.openWallet(
{id: stewardWalletName},
{key: 'whatever'}
);
let stewardDidInfo = {
'seed': '000000000000000000000000Steward1'
};
[stewardDid, stewardKey] = await sdk.createAndStoreMyDid(stewardWallet, stewardDidInfo);
}
exports.getVerinym = async function(poolHandle, From, fromWallet, fromDid, fromToKey, to, toWallet, toFromDid, toFromKey, role) {
console.log(`\"${to}\" > Create and store in Wallet \"${to}\" new DID"`);
let [toDid, toKey] = await indy.createAndStoreMyDid(toWallet, {});
console.log(`\"${to}\" > Authcrypt \"${to} DID info\" for \"${From}\"`);
let didInfoJson = JSON.stringify({
'did': toDid,
'verkey': toKey
});
let authcryptedDidInfo = await indy.cryptoAuthCrypt(toWallet, toFromKey, fromToKey, Buffer.from(didInfoJson, 'utf8'));
console.log(`\"${to}\" > Send authcrypted \"${to} DID info\" to ${From}`);
console.log(`\"${From}\" > Authdecrypted \"${to} DID info\" from ${to}`);
let [senderVerkey, authdecryptedDidInfo] =
await indy.cryptoAuthDecrypt(fromWallet, fromToKey, Buffer.from(authcryptedDidInfo));
let authdecryptedDidInfoJson = JSON.parse(Buffer.from(authdecryptedDidInfo));
console.log(`\"${From}\" > Authenticate ${to} by comparision of Verkeys`);
exports.createDid = async function (didInfoParam) {
let didInfo = didInfoParam || {};
return await sdk.createAndStoreMyDid(await indy.wallet.get(), didInfo);
};