Virtru SDK for C++  1.0.24
Virtru C++ SDK library - Create, Read, and Manage TDF3 Files
Virtru SDK for C++

The Virtru SDK allows developers to securely and easily encrypt and manage authenticated access to sensitve data. This comprehensive documentation serves as the source of truth for the functionality and usage of the Virtru C++ SDK.

  • For information on Virtru SDKs for other languages, visit here
  • Download and getting started information for the C++ SDK is here

Core Concepts

  • TDF Ciphertext - Ciphertext encrypted using the open TDF specification. Each /i TDF /i Ciphertext is encrypted with a unique data key and managed with independent access controls. See the Developer Hub and TDF whitepaper for more information.
  • Virtru Policy - A policy specifying access controls that will be enforced on encrypted data, such as expiry and authorized users.
  • User - An entity authenticated with Virtru. SDK users can allow other users access to encrypted data. For instance, bob@virtru.com can authorize alice@virtru.com to access some encrypted data at either encryption-time or any time afterwards.

Getting Help

There are many ways to get our attention.

  • You can join Virtru's Developer Hub Community Slack channel to get your questions answered.
  • You can open a support ticket here

Encrypt example

To encrypt a file, the calls you need are :
// Create an instance of the Virtru client.
Client client {user, appId};
// Use the client instance to encrypt a file
auto policyId = client.encryptFile({samplePlaintextFilename, sampleCiphertextFilename});

Decrypt example

Decrypting a file is done this way :
// Use the client instance to decrypt the file again
client.decryptFile(sampleCiphertextFilename, sampleDecryptedFilename);

Policy update example

After you have encrypted a file, you can change the policy that governs it. Here is how to add a user, and set an expiration date :
// Add a user
Policy policy;
policy.shareWithUsers({"someOtherUser@place.com"});
// Set an expiration date in the future
policy.addExpiration("2099-05-24");
// Update the policy changes at the server
client.updatePolicyForUUID(policy, policyId);