You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
Hi @jelordreygulle below is an example from our dev hub. Take a look and let me know if this helps.
constVirtru=require('virtru-sdk');constAWS=require('aws-sdk');/** * Example showing how to encrypt and write a file to S3. * * This example assumes you've installed the aws-sdk module and set up your AWS * credentials file. For more information, see: https://github.com/aws-samples/aws-nodejs-sample * * Example usage: * node sample.js your@email.com $(cat ~/.virtru/appId) hello.txt my-s3-bucket * * If your bucket is configured for static website hosting you'll be able to * open up Secure Reader directly from the object link. * (e.g., http://my-s3-bucket.s3-website-us-west-2.amazonaws.com/hello.txt.html) */constemail=process.argv[2];constappId=process.argv[3];constlocalFilename=process.argv[4];constbucketName=process.argv[5];// Initialize the Virtru and S3 clients.constclient=newVirtru.Client({email, appId});consts3=newAWS.S3();// Derive the object key to use by appending .html for easy browser support.constkey=`${localFilename}.html`;constencryptParams=newVirtru.EncryptParamsBuilder().withFileSource(localFilename).withDisplayFilename(localFilename).build();// The returned stream can be passed directly to s3.upload().client.encrypt(encryptParams).then(ct=>s3.upload({Body: ct,Bucket: bucketName,Key: key,ContentType: 'html/text'},onComplete));functiononComplete(err,data){console.log(`${localFilename} encrypted and uploaded to S3 as ${key}`);}
Do you have some example implementation Sir on Encrypt/Decrypt & Upload a File to S3 using the node js sdk of virtru ? Thanks.
The text was updated successfully, but these errors were encountered: