Example HTML Form and JavaScript that will create 2 TDFs and upload to S3.
- S3 Cognito credentials
- S3 Bucket
- Cognito credentials must have "appropriate" rights to the S3 Bucket
- s3:PutObject
- s3:GetObjectAcl
- s3:GetObject
- s3:DeleteObject
- s3:PutObjectAcl
- Visual Studio Code Live Server Extension
- Start a Web Server Locally - Local Dev Server
cd virtru-sdk-js-upload-form
npm install -g dev-web-server
dev-web-server
npm uninstall -g dev-web-server
This example uses the standard S3 Cognito configuration to access the S3 bucket for upload.
This will:
- Create a JSON file of the Text Fields
- Encrypt the JSON using the Virtru SDK client-side
- Encrypt the file in the file input filed using the Virtru SDK
# clone the repository
$ git clone http://github.com/virtru/virtru-sdk-js-samples.git
# change directory
$ cd virtru-sdk-js-samples/virtru-sdk-js-webform
# Add Keys
# open js/aws_s3.js
# -update "BucketName"
# -update "BucketRegion"
# -update "IdentityPoolId"
# Add Form Owner Email Address
# open index.html
# -update "formOwner"
# Run Example
# Visit web form on host