Virtru SDK for C++  2.8.0
Virtru C++ SDK library - Create, Read, and Manage TDF3 Files
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
virtru Namespace Reference

Classes

class  INetwork
 
struct  BufferSpan
 
class  Exception
 
struct  LogMessage
 
class  ILogger
 
class  AuditService
 
class  Client
 
class  ClientConfig
 
class  ConfigService
 
class  Credentials
 
class  CredentialsAppId
 
class  CredentialsHmac
 
class  CredentialsOidc
 
class  EncryptDataParams
 
class  EncryptFileParams
 
class  EncryptParams
 
class  EncryptStreamParams
 
class  EncryptStringParams
 
class  Policy
 

Typedefs

using HttpHeaders = std::unordered_map< std::string, std::string >
 
using HTTPServiceCallback = std::function< void(unsigned int statusCode, std::string &&response)>
 
typedef uint8_t VBYTE
 
using TDFDataSourceCb = std::function< BufferSpan(Status &) >
 
using TDFDataSinkCb = std::function< Status(BufferSpan)>
 
typedef std::map< std::string,
std::string > 
OIDCHeaders
 

Enumerations

enum  KeyType { KeyType::split }
 
enum  CipherType { CipherType::Aes256GCM, CipherType::Aes265CBC }
 
enum  IntegrityAlgorithm { IntegrityAlgorithm::HS256, IntegrityAlgorithm::GMAC }
 
enum  KeyAccessType { KeyAccessType::Remote, KeyAccessType::Wrapped }
 
enum  Protocol { Protocol::Zip, Protocol::Html, Protocol::Xml }
 
enum  LogLevel {
  LogLevel::Trace, LogLevel::Debug, LogLevel::Info, LogLevel::Warn,
  LogLevel::Error, LogLevel::Fatal, LogLevel::Current
}
 
enum  Status { Status::Success, Status::Failure }
 
enum  EllipticCurve : std::uint8_t { EllipticCurve::SECP256R1 = 0x00, EllipticCurve::SECP384R1 = 0x01, EllipticCurve::SECP521R1 = 0x02, EllipticCurve::SECP256K1 = 0x03 }
 
enum  NanoTDFPolicyType : std::uint8_t { NanoTDFPolicyType::REMOTE_POLICY = 0x00, NanoTDFPolicyType::EMBEDDED_POLICY_PLAIN_TEXT = 0x01, NanoTDFPolicyType::EMBEDDED_POLICY_ENCRYPTED = 0x02, NanoTDFPolicyType::EMBEDDED_POLICY_ENCRYPTED_POLICY_KEY_ACCESS = 0x03 }
 
enum  NanoTDFCipher : std::uint8_t {
  NanoTDFCipher::AES_256_GCM_64_TAG = 0x00, NanoTDFCipher::AES_256_GCM_96_TAG = 0x01, NanoTDFCipher::AES_256_GCM_104_TAG = 0x02, NanoTDFCipher::AES_256_GCM_112_TAG = 0x03,
  NanoTDFCipher::AES_256_GCM_120_TAG = 0x04, NanoTDFCipher::AES_256_GCM_128_TAG = 0x05, NanoTDFCipher::EAD_AES_256_HMAC_SHA_256 = 0x06
}
 
enum  CredentialsType {
  CredentialsType::None, CredentialsType::AppId, CredentialsType::HMAC, CredentialsType::VJWT,
  CredentialsType::OIDC
}
 

Functions

void _ThrowVirtruException (std::string &&errorStringPrefix, const char *fileName, unsigned int lineNumber, int code=VIRTRU_GENERAL_ERROR)
 

Variables

const uint32_t kNTDFMaxKeyIterations = 8388606
 
constexpr auto kKasUrl = "https://api.virtru.com/kas"
 
constexpr auto kAcmUrl = "https://api.virtru.com/acm"
 
constexpr auto kEasUrl = "https://api.virtru.com/accounts"
 
constexpr auto kRcaUrl = "https://api.virtru.com/rca"
 
constexpr auto kEncryptedStorageUrl = "https://api.virtru.com/encrypted-storage"
 
constexpr auto kSecureReaderUrl = "https://secure.virtru.com/start?htmlProtocol=1"
 
static constexpr auto kKasUrlUpsert = "/upsert"
 
static constexpr auto kEntityobjectURL = "/entityobject"
 
static constexpr auto kUserSettingsURL = "/userSettings"
 
static constexpr auto kRegisterClientPubKey = "/appIdBundle/public-key"
 
static constexpr auto kRevokeUrl = "/api/policies/revoke"
 
static constexpr auto kPoliciesUrl = "/api/policies"
 
static constexpr auto kAcceptHeaderKey = "Accept"
 
static constexpr auto kAcceptHeaderValue = "application/json"
 
static constexpr auto kUserAgentHeaderKey = "User-Agent"
 
static constexpr auto kVirtruSignedRequestToken = "x-virtru-signed-request-token"
 
static constexpr auto kDefaultSegmentSize = (2 * 1024 * 1024)
 
static constexpr auto kFlagReshare = "forward"
 
static constexpr auto kFlagOneClick = "no-auth"
 
static constexpr auto kFlagWatermark = "watermark"
 
static constexpr auto kFlagPrint = "print"
 
static constexpr auto kFlagCopy = "copy"
 
static constexpr auto kFlagPersistentProtection = "persistent-protection"
 
static constexpr auto kFlagPreventDownload = "prevent-download"
 
static constexpr auto kFlagExpiration = "expiration"
 
static constexpr auto kTDFOwner = "owner"
 
static constexpr auto kPolicyOwner = "owner"
 
static constexpr auto kDisplayName = "displayName"
 
static constexpr auto kDisplayMessage = "displayMessage"
 
static constexpr auto kFileProvider = "fileProvider"
 
static constexpr auto kEmail = "email"
 
static constexpr auto kUuid = "uuid"
 
static constexpr auto kUuids = "uuids"
 
static constexpr auto kDissems = "dissems"
 
static constexpr auto kSimplePolicy = "simplePolicy"
 
static constexpr auto kEmailUsers = "emailUsers"
 
static constexpr auto kAuthorizations = "authorizations"
 
static constexpr auto kState = "state"
 
static constexpr auto kStateActive = "active"
 
static constexpr auto kStateDeactivated = "deactivated"
 
static constexpr auto kActiveBegin = "activeBegin"
 
static constexpr auto kActiveEnd = "activeEnd"
 
static constexpr auto kIsManaged = "isManaged"
 
static constexpr auto kAccessedBy = "accessedBy"
 
static constexpr auto k_Id = "_id"
 
static constexpr auto k_Rev = "_rev"
 
static constexpr auto kId = "id"
 
static constexpr auto kVersion = "version"
 
static constexpr auto kType = "type"
 
static constexpr auto kOwner = "owner"
 
static constexpr auto kLicenseOwnerId = "licenseOwnerId"
 
static constexpr auto kKey = "key"
 
static constexpr auto kValue = "value"
 
static constexpr auto kVirtruDataOwner = "virtru:data:owner"
 
static constexpr auto kHtmlTDFExtension = ".html"
 
static constexpr auto kZipTDFExtension = ".tdf"
 
static constexpr auto kCPPFileProvider = "virtru-sdk-cpp"
 
static constexpr auto kDefaultDisplayMessage = "Encrypted using Virtru C++ SDK"
 
static constexpr auto kPythonDisplayMessage = "Encrypted using Virtru Python SDK"
 
static constexpr auto kPythonFileProvider = "virtru-sdk-python"
 
static constexpr auto kCPPPlatform = "virtru-sdk-cpp"
 
static constexpr auto kPythonPlatform = "virtru-sdk-python"
 
static constexpr auto kAppIdBundle = "appIdBundle"
 
static constexpr auto kOrgPublicKey = "orgPublicKey"
 
static constexpr auto kDelegatedKey = "delegatedKey"
 
static constexpr auto kFingerprint = "fingerprint"
 
static constexpr auto kPublicKeyFingerprint = "publicKeyFingerprint"
 

Detailed Description

The Client is the entry point for all the major Virtru operations, such as encrypt, decrypt and policy management. The user of this class should catch virtru::Expection for any failure.

Typedef Documentation

using virtru::HttpHeaders = typedef std::unordered_map<std::string, std::string>
using virtru::HTTPServiceCallback = typedef std::function<void(unsigned int statusCode, std::string &&response)>
typedef std::map<std::string, std::string> virtru::OIDCHeaders
using virtru::TDFDataSinkCb = typedef std::function < Status(BufferSpan)>
using virtru::TDFDataSourceCb = typedef std::function < BufferSpan(Status &) >
typedef uint8_t virtru::VBYTE

Enumeration Type Documentation

enum virtru::CipherType
strong
Enumerator
Aes256GCM 

default

Aes265CBC 
Enumerator
None 

default - no credentials specified

AppId 

AppId and email address.

HMAC 

owner, apikey, and secret

VJWT 

issuer, tokenId, and secret

OIDC 

Open ID.

enum virtru::EllipticCurve : std::uint8_t
strong
Enumerator
SECP256R1 
SECP384R1 
SECP521R1 
SECP256K1 
Enumerator
HS256 

default

GMAC 
enum virtru::KeyAccessType
strong
Enumerator
Remote 

default

Wrapped 

The key is embedded in the TDF.

enum virtru::KeyType
strong
Enumerator
split 

default

enum virtru::LogLevel
strong

Defines a log level.

Enumerator
Trace 

Most detailed output.

Debug 
Info 
Warn 
Error 
Fatal 

Least detailed output.

Current 

no-op, value indicates current level should be retained

enum virtru::NanoTDFCipher : std::uint8_t
strong
Enumerator
AES_256_GCM_64_TAG 
AES_256_GCM_96_TAG 
AES_256_GCM_104_TAG 
AES_256_GCM_112_TAG 
AES_256_GCM_120_TAG 
AES_256_GCM_128_TAG 
EAD_AES_256_HMAC_SHA_256 
enum virtru::NanoTDFPolicyType : std::uint8_t
strong
Enumerator
REMOTE_POLICY 
EMBEDDED_POLICY_PLAIN_TEXT 
EMBEDDED_POLICY_ENCRYPTED 
EMBEDDED_POLICY_ENCRYPTED_POLICY_KEY_ACCESS 
enum virtru::Protocol
strong
Enumerator
Zip 

TDF format is zip.

Html 

Default format is HTML.

Xml 
enum virtru::Status
strong
Enumerator
Success 

Operation completed successfully.

Failure 

Operation did not complete successfully.

Function Documentation

void virtru::_ThrowVirtruException ( std::string &&  errorStringPrefix,
const char *  fileName,
unsigned int  lineNumber,
int  code = VIRTRU_GENERAL_ERROR 
)
inline

Utility method to throw exception with filename and line number.

Parameters
errorStringPrefix- The error message.
fileName- The source file name.
lineNumber- The current line number in the source file.
code- The error code - default 1

Variable Documentation

constexpr auto virtru::k_Id = "_id"
static
constexpr auto virtru::k_Rev = "_rev"
static
constexpr auto virtru::kAcceptHeaderKey = "Accept"
static
constexpr auto virtru::kAcceptHeaderValue = "application/json"
static
constexpr auto virtru::kAccessedBy = "accessedBy"
static
constexpr auto virtru::kAcmUrl = "https://api.virtru.com/acm"
constexpr auto virtru::kActiveBegin = "activeBegin"
static
constexpr auto virtru::kActiveEnd = "activeEnd"
static
constexpr auto virtru::kAppIdBundle = "appIdBundle"
static

User Settings.

constexpr auto virtru::kAuthorizations = "authorizations"
static
constexpr auto virtru::kCPPFileProvider = "virtru-sdk-cpp"
static
constexpr auto virtru::kCPPPlatform = "virtru-sdk-cpp"
static
constexpr auto virtru::kDefaultDisplayMessage = "Encrypted using Virtru C++ SDK"
static
constexpr auto virtru::kDefaultSegmentSize = (2 * 1024 * 1024)
static
constexpr auto virtru::kDelegatedKey = "delegatedKey"
static
constexpr auto virtru::kDisplayMessage = "displayMessage"
static
constexpr auto virtru::kDisplayName = "displayName"
static
constexpr auto virtru::kDissems = "dissems"
static
constexpr auto virtru::kEasUrl = "https://api.virtru.com/accounts"
constexpr auto virtru::kEmail = "email"
static
constexpr auto virtru::kEmailUsers = "emailUsers"
static
constexpr auto virtru::kEncryptedStorageUrl = "https://api.virtru.com/encrypted-storage"
constexpr auto virtru::kEntityobjectURL = "/entityobject"
static
constexpr auto virtru::kFileProvider = "fileProvider"
static
constexpr auto virtru::kFingerprint = "fingerprint"
static
constexpr auto virtru::kFlagCopy = "copy"
static
constexpr auto virtru::kFlagExpiration = "expiration"
static
constexpr auto virtru::kFlagOneClick = "no-auth"
static
constexpr auto virtru::kFlagPersistentProtection = "persistent-protection"
static
constexpr auto virtru::kFlagPreventDownload = "prevent-download"
static
constexpr auto virtru::kFlagPrint = "print"
static
constexpr auto virtru::kFlagReshare = "forward"
static
constexpr auto virtru::kFlagWatermark = "watermark"
static
constexpr auto virtru::kHtmlTDFExtension = ".html"
static
constexpr auto virtru::kId = "id"
static
constexpr auto virtru::kIsManaged = "isManaged"
static
constexpr auto virtru::kKasUrl = "https://api.virtru.com/kas"
constexpr auto virtru::kKasUrlUpsert = "/upsert"
static
constexpr auto virtru::kKey = "key"
static
constexpr auto virtru::kLicenseOwnerId = "licenseOwnerId"
static
const uint32_t virtru::kNTDFMaxKeyIterations = 8388606
constexpr auto virtru::kOrgPublicKey = "orgPublicKey"
static
constexpr auto virtru::kOwner = "owner"
static
constexpr auto virtru::kPoliciesUrl = "/api/policies"
static
constexpr auto virtru::kPolicyOwner = "owner"
static
constexpr auto virtru::kPublicKeyFingerprint = "publicKeyFingerprint"
static
constexpr auto virtru::kPythonDisplayMessage = "Encrypted using Virtru Python SDK"
static
constexpr auto virtru::kPythonFileProvider = "virtru-sdk-python"
static
constexpr auto virtru::kPythonPlatform = "virtru-sdk-python"
static
constexpr auto virtru::kRcaUrl = "https://api.virtru.com/rca"
constexpr auto virtru::kRegisterClientPubKey = "/appIdBundle/public-key"
static
constexpr auto virtru::kRevokeUrl = "/api/policies/revoke"
static
constexpr auto virtru::kSecureReaderUrl = "https://secure.virtru.com/start?htmlProtocol=1"
constexpr auto virtru::kSimplePolicy = "simplePolicy"
static
constexpr auto virtru::kState = "state"
static
constexpr auto virtru::kStateActive = "active"
static
constexpr auto virtru::kStateDeactivated = "deactivated"
static
constexpr auto virtru::kTDFOwner = "owner"
static
constexpr auto virtru::kType = "type"
static
constexpr auto virtru::kUserAgentHeaderKey = "User-Agent"
static
constexpr auto virtru::kUserSettingsURL = "/userSettings"
static
constexpr auto virtru::kUuid = "uuid"
static
constexpr auto virtru::kUuids = "uuids"
static
constexpr auto virtru::kValue = "value"
static
constexpr auto virtru::kVersion = "version"
static
constexpr auto virtru::kVirtruDataOwner = "virtru:data:owner"
static
constexpr auto virtru::kVirtruSignedRequestToken = "x-virtru-signed-request-token"
static
constexpr auto virtru::kZipTDFExtension = ".tdf"
static