Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main () {
console.log(`Application: using Tanker version: ${Tanker.version}`);
// Randomize emails so that each test runs with new users
const aliceEmail = `alice-${uuid()}@example.com`;
const bobEmail = `bob-${uuid()}@example.com`;
// Init tanker
console.log('Application: init Tanker object');
const tankerConfig = await getTankerConfig();
const tanker = new Tanker(tankerConfig);
// Open Bob's session to make sure his account exists
const bob = await signUp(bobEmail);
console.log('Application: starting Tanker session for Bob');
await tanker.start(bob.identity);
await tanker.registerIdentity({ passphrase: 'Bob\'s secret passphrase'});
await tanker.stop();
console.log('Application: stopping Tanker session for Bob');
// Open Alice's session
const alice = await signUp(aliceEmail);
console.log('Application: starting Tanker session for Alice');
await tanker.start(alice.identity);
await tanker.registerIdentity({ passphrase: 'Alice\'s secret passphrase' });
console.log('Application: encrypting message for Bob');