Created
November 5, 2019 16:59
-
-
Save trevorfoskett/6caec35d38e73fa2a6349e8cd118e8be to your computer and use it in GitHub Desktop.
Default Virtru JS Client from quickstart.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div id="virtru-auth-widget-mount"></div> | |
<script type="text/javascript"> | |
async function afterAuth(email) { | |
// Run all client code from here. | |
// This will only be called when the user is successfully authenticated. | |
const client = new Virtru.Client({email}); | |
const yourString = prompt('Type a sting to encrypt: ', 'Hello, world!'); | |
const encryptParams = new Virtru.EncryptParamsBuilder() | |
.withStringSource(yourString) | |
.withDisplayFilename('hello.txt') | |
.build(); | |
const ct = await client.encrypt(encryptParams); | |
await ct.toFile('hello.html'); | |
} | |
// Set up the auth widget. | |
Virtru.AuthWidget('virtru-auth-widget-mount', {afterAuth}); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment