Virtru SDK for C#  2.8.0
Virtru C# SDK module - Create, Read, and Manage TDF3 Files
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Pages
Virtru.SDK.Client Class Reference
Inheritance diagram for Virtru.SDK.Client:

Public Member Functions

void Dispose ()
 
 Client (string owner, string appId)
 
 Client (string owner, string apiKey, string apiSecret)
 
 Client (string owner, string organizationName, string clientId, string clientSecret)
 
 Client (Credentials credentials)
 
void setKasUrl (string kasUrl)
 
void setOIDCProviderUrl (string oidcUrl)
 
void setEasUrl (string easUrl)
 
void setAcmUrl (string acmUrl)
 
void setSecureReaderURL (string srUrl)
 
void setEncryptedStorageURL (string encryptedStorageUrl)
 
void setRCAServiceURL (string rcaServiceURL)
 
void setProtocol (Protocol protocol)
 
void setOffline (bool state)
 
void setKeyAccessType (KeyAccessType keyAccessType)
 
void enableConsoleLogging (LogLevel logLevel)
 
void enableConsoleLogging ()
 
void setExternalLogger (SWIGTYPE_p_std__shared_ptrT_virtru__ILogger_t externalLogger, LogLevel logLevel)
 
void setExternalLogger (SWIGTYPE_p_std__shared_ptrT_virtru__ILogger_t externalLogger)
 
void setCertAuthority (string certAuthority)
 
string encryptFile (EncryptFileParams encryptFileParam)
 
SWIGTYPE_p_std__pairT_std__string_std__string_t encryptFileToRCA (EncryptFileParams encryptFileParam)
 
string encryptStream (EncryptStreamParams encryptStreamParams)
 
SWIGTYPE_p_std__pairT_std__string_std__string_t encryptString (EncryptStringParams encryptStringParams)
 
SWIGTYPE_p_std__pairT_std__string_std__string_t encryptStringToRCA (EncryptStringParams encryptStringParams)
 
void decryptFile (string inFilepath, string outFilepath)
 
void decryptRCAToFile (string rcaLink, string outFilepath)
 
void decryptStream (SWIGTYPE_p_std__istream inStream, SWIGTYPE_p_std__ostream outStream)
 
string decryptString (string tdfData)
 
string decryptRCAToString (string rcaLink)
 
void updatePolicyForUUID (Policy policy, string policyUUID)
 
void updatePolicyForUUIDs (Policy policy, StringVector policyUUIDs)
 
void updatePolicyForFile (Policy policy, string tdfFile)
 
void updatePolicyForFiles (Policy policy, StringVector files)
 
void revokePolicy (string policyUUID)
 
void revokePolicies (StringVector policyUUIDs)
 
void revokeFile (string tdfFile)
 
void revokeFiles (StringVector files)
 
Policy fetchPolicyForUUID (string policyUUID)
 
string getUserId ()
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Protected Attributes

bool swigCMemOwn
 

Package Functions

 Client (global::System.IntPtr cPtr, bool cMemoryOwn)
 

Static Package Functions

static
global::System.Runtime.InteropServices.HandleRef 
getCPtr (Client obj)
 
static
global::System.Runtime.InteropServices.HandleRef 
swigRelease (Client obj)
 

Private Member Functions

 ~Client ()
 

Private Attributes

global::System.Runtime.InteropServices.HandleRef swigCPtr
 

Constructor & Destructor Documentation

Virtru.SDK.Client.Client ( global::System.IntPtr  cPtr,
bool  cMemoryOwn 
)
inlinepackage
Virtru.SDK.Client.~Client ( )
inlineprivate
Virtru.SDK.Client.Client ( string  owner,
string  appId 
)
inline

DEPRECATED in favor of OIDC client credential flows Constructs a new Client instance with owner and appId.

Parameters
owner- The owner's email address to be used to authenticate for encrypt, decrypt and policy management. Any data encrypted will be owned by the supplied email address. The owner will always have access to the encrypted data (TDF).
appId- The virtru application ID can be obtained from the Virtru Dashboard
Virtru.SDK.Client.Client ( string  owner,
string  apiKey,
string  apiSecret 
)
inline

DEPRECATED in favor of OIDC client credential flows Constructs a new Client instance with owner and HMAC apiKey/apiSecret. Contact Virtru to get your organization's HMAC apiKey/apiSecret

Parameters
owner- The owner's email address to be used to authenticate for encrypt, decrypt and policy management.
apiKey- The HMAC api key
apiSecret- The HMAC api secret
Virtru.SDK.Client.Client ( string  owner,
string  organizationName,
string  clientId,
string  clientSecret 
)
inline

Constructs a new Client instance with Owner and OIDC client credentials, associated with a specific organization/realm.

Parameters
owner- The owner's email address to be used to authenticate for encrypt, decrypt
organizationName- The OIDC realm or organization the client belongs to
clientId- The clientId part of the client credentialset issued to the client
  • The clientSecret part of the client credentialset issued to the client
Virtru.SDK.Client.Client ( Credentials  credentials)
inline

Constructs a new Client instance based on a Credentials object

Parameters
credentials- The Credentials object containing authorization details

Member Function Documentation

void Virtru.SDK.Client.decryptFile ( string  inFilepath,
string  outFilepath 
)
inline

Decrypt the contents of the TDF file into its original content.

Parameters
inFilepath- The TDF file on which the decryption is performed
outFilepath- The file path of the original content after successful decryption
void Virtru.SDK.Client.decryptRCAToFile ( string  rcaLink,
string  outFilepath 
)
inline

Decrypt the remote contents(RCA) file into its original content.

Parameters
rcaLink- The link contains the information of remote content
outFilepath- The file path of the original content after successful decryption
string Virtru.SDK.Client.decryptRCAToString ( string  rcaLink)
inline

Decrypt the remote content TDF(RCA)

Parameters
rcaLink- The link contains the information of remote content
Returns
plain data - Return the decrypted tdf data.
void Virtru.SDK.Client.decryptStream ( SWIGTYPE_p_std__istream  inStream,
SWIGTYPE_p_std__ostream  outStream 
)
inline

Decrypt the contents of the TDF stream data into its original content.

Parameters
inStream- The TDF stream on which the decryption is performed
outStream- The output stream with the original content after successful decryption
string Virtru.SDK.Client.decryptString ( string  tdfData)
inline

Decrypt the TDF data

Parameters
tdfData- The tdf data to be decrypted.
Returns
plain data - Return the decrypted tdf data.
void Virtru.SDK.Client.Dispose ( )
inline
virtual void Virtru.SDK.Client.Dispose ( bool  disposing)
inlineprotectedvirtual
void Virtru.SDK.Client.enableConsoleLogging ( LogLevel  logLevel)
inline

Optional - Logging

Enable the internal logger class to write logs to the console for given LogLevel. The default Loglevel is to keep the current level if not specified.

Parameters
logLevel- The log level
void Virtru.SDK.Client.enableConsoleLogging ( )
inline

Optional - Logging

Enable the internal logger class to write logs to the console for given LogLevel. The default Loglevel is to keep the current level if not specified.

string Virtru.SDK.Client.encryptFile ( EncryptFileParams  encryptFileParam)
inline

Encrypt the contents of the input file into a TDF. In the process of encryption, a policy is associated with the TDF. The policy has a unique id which can be used to identify the TDF policy.

Returns
Policy uuid of the TDF, can be used later to update the policy controls

SWIGTYPE_p_std__pairT_std__string_std__string_t Virtru.SDK.Client.encryptFileToRCA ( EncryptFileParams  encryptFileParam)
inline

Encrypt the contents of the input file into a RCA TDF. In the process of encryption, a policy is associated with the TDF. The policy has a unique id which can be used to identify the TDF policy.

Returns
std::pair of policy uuid and RCA tdf link. policy uuid can be used later to update the policy controls

string Virtru.SDK.Client.encryptStream ( EncryptStreamParams  encryptStreamParams)
inline

Encrypt the contents of the stream into a TDF. In the process of encryption, a policy is associated with the TDF. The policy has a unique id which can be used to identify the TDF policy.

Parameters
encryptStreamParams- Object holding all the required information for encrypt operations
Returns
Policy uuid of the TDF, can be used later to update the policy controls
SWIGTYPE_p_std__pairT_std__string_std__string_t Virtru.SDK.Client.encryptString ( EncryptStringParams  encryptStringParams)
inline

Encrypt the plain data into a TDF. In the process of encryption, a policy is associated with the TDF. The policy has a unique id which can be used to identify the TDF policy.

Returns
std::pair of policy uuid and tdf data. policy uuid can be used later to update the policy controls

SWIGTYPE_p_std__pairT_std__string_std__string_t Virtru.SDK.Client.encryptStringToRCA ( EncryptStringParams  encryptStringParams)
inline

Encrypt the plain data into a remote TDF. In the process of encryption, a policy is associated with the TDF. The policy has a unique id which can be used to identify the TDF policy.

Returns
std::pair of policy uuid and rca link. policy uuid can be used later to update the policy controls

Policy Virtru.SDK.Client.fetchPolicyForUUID ( string  policyUUID)
inline

Return the policy associated with the given policyId.

Parameters
policyUUID- The policy uuid of the TDF.
Returns
Policy - The policy associated with the TDF.
static global.System.Runtime.InteropServices.HandleRef Virtru.SDK.Client.getCPtr ( Client  obj)
inlinestaticpackage
string Virtru.SDK.Client.getUserId ( )
inline

Return the userId associated with this client according to the EntityObject

Returns
userId - The userId associated with this client

void Virtru.SDK.Client.revokeFile ( string  tdfFile)
inline

Revoke access for all users that were granted access to the TDF file. The owner of the TDF will still have access.

Parameters
tdfFile- The TDF file
void Virtru.SDK.Client.revokeFiles ( StringVector  files)
inline

Revoke access for all users that were granted acccess to the TDF files. The owner of the TDF will still have access.

Parameters
files- Vector of TDF files.
void Virtru.SDK.Client.revokePolicies ( StringVector  policyUUIDs)
inline

Revoke access for all users that were granted access to the TDF files associated with the specified policies. The owner of the TDF will still have access.

Parameters
policyUUIDs- Vector of policy uuids
void Virtru.SDK.Client.revokePolicy ( string  policyUUID)
inline

Revoke access for all the users that were granted access to the TDF file associated with the specified policy. The owner of the TDF will still have access.

Parameters
policyUUID- The policy uuid of the TDF
void Virtru.SDK.Client.setAcmUrl ( string  acmUrl)
inline

Set the ACM url that will be used for TDF policy sync operations. Optional - this method should be only used if you have your own acm server infrastructure.

Parameters
acmUrl- The ACM server url
void Virtru.SDK.Client.setCertAuthority ( string  certAuthority)
inline

Optional - configure root CA's

Set the cert authority which will be used in SSL handshake for all the network I/O. NOTE: This is optional. If not specified, the SDK will supply a default.

Parameters
certAuthority- A string which holds the cert authority which will be used in SSL handshake for all the network I/O
void Virtru.SDK.Client.setEasUrl ( string  easUrl)
inline

DEPRECATED OIDC auth flows do not use EAS. Set the EAS url that will be used for TDF operations. Optional - this method should be only used if you have your own entity attribute server infrastructure.

Parameters
easUrl- The EAS (Entity Attribute Server) url
void Virtru.SDK.Client.setEncryptedStorageURL ( string  encryptedStorageUrl)
inline

Set the encrypted storage url that will be used for storing remote TDFs. Optional - this method should be only used if you have your own secure storage server infrastructure.

Parameters
encryptedStorageUrl- The encrypted storage url
void Virtru.SDK.Client.setExternalLogger ( SWIGTYPE_p_std__shared_ptrT_virtru__ILogger_t  externalLogger,
LogLevel  logLevel 
)
inline

Optional - Set the external logger instance. The internal logger will be used if the caller does not specify one. The caller is responsible for ownership of the logger instance.

NOTE: Once you use this method, the internal logger class is freed, and the internal logger will no longer be used.

Parameters
externalLogger- The external logger instance (std::shared_ptr).
logLevel- The log level, the default is to keep the current level if not specified.
void Virtru.SDK.Client.setExternalLogger ( SWIGTYPE_p_std__shared_ptrT_virtru__ILogger_t  externalLogger)
inline

Optional - Set the external logger instance. The internal logger will be used if the caller does not specify one. The caller is responsible for ownership of the logger instance.

NOTE: Once you use this method, the internal logger class is freed, and the internal logger will no longer be used.

Parameters
externalLogger- The external logger instance (std::shared_ptr).
void Virtru.SDK.Client.setKasUrl ( string  kasUrl)
inline

Optional

Note: Defaults will be used if these methods are not used.

Set the KAS url that will be used for TDF operations. Optional - this method should be only used if you have your own key access server infrastructure.

Parameters
kasUrl- The KAS (Key Access Server) url
void Virtru.SDK.Client.setKeyAccessType ( KeyAccessType  keyAccessType)
inline

Set the type of key access. The types of key access are 'Remote' and 'Wrapped'. Remote - The key is stored on remote server. Wrapped - The key is embedded in TDF. The default is the recommended type 'Remote'

Parameters
keyAccessType- The key access type.
void Virtru.SDK.Client.setOffline ( bool  state)
inline

Set the offline mode.

Parameters
state- If true, all the TDFs will be encrypted in offline mode that means the sysmetric key stored part of the TDF instead on the server. NOTE: This is same as setKeyAccessType
void Virtru.SDK.Client.setOIDCProviderUrl ( string  oidcUrl)
inline

Set the OIDC provider url that the client will authenticate with, if using OIDC credentials. Optional - You should typically only set this if you're not using Virtru's OIDC provider.

Parameters
oidcUrl- The OIDC IdP (Identity Provider) url to use.
void Virtru.SDK.Client.setProtocol ( Protocol  protocol)
inline

Set the TDF protocol (format) to be used for encryption and decryption operations. HTML is the default format. The protocols refer to the data format after encryption. Options are .tdf (which is a zip) or HTML.

Parameters
protocol- type of the protocol (format)
void Virtru.SDK.Client.setRCAServiceURL ( string  rcaServiceURL)
inline

Set the rca service url that will be used for storing remote TDFs. Optional - this method should be only used if you have your own rca service server infrastructure.

Parameters
rcaServiceURL- The rca service url
void Virtru.SDK.Client.setSecureReaderURL ( string  srUrl)
inline

Set the secure reader url which will be used in html format TDF. This is the URL that will be used on opening the .html TDF. Optional - Should be only used if you host your own secure reader.

Parameters
srUrl- The secure reader url
static global.System.Runtime.InteropServices.HandleRef Virtru.SDK.Client.swigRelease ( Client  obj)
inlinestaticpackage
void Virtru.SDK.Client.updatePolicyForFile ( Policy  policy,
string  tdfFile 
)
inline

Update the policy for the given TDF file

Parameters
policy- The policy object with new controls
tdfFile- The TDF file path
void Virtru.SDK.Client.updatePolicyForFiles ( Policy  policy,
StringVector  files 
)
inline

Update the policy for multiple TDF files

Parameters
policy- The policy object with new controls
files- List of TDF files
void Virtru.SDK.Client.updatePolicyForUUID ( Policy  policy,
string  policyUUID 
)
inline

Update the policy for a given TDF file using its policy uuid.

Parameters
policy- The policy object with new controls
policyUUID- The policy uuid of the TDF
void Virtru.SDK.Client.updatePolicyForUUIDs ( Policy  policy,
StringVector  policyUUIDs 
)
inline

Update the policy for multiple TDFs using their policy uuids.

Parameters
policy- The policy object with new controls
policyUUIDs- The vector of policy uuids for the TDFs

Member Data Documentation

bool Virtru.SDK.Client.swigCMemOwn
protected
global.System.Runtime.InteropServices.HandleRef Virtru.SDK.Client.swigCPtr
private

The documentation for this class was generated from the following file: