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::Policy Class Reference

#include <virtru_policy.h>

Public Member Functions

 Policy ()
 
 ~Policy ()
 
 Policy (const Policy &policy)
 
Policyoperator= (const Policy &policy)
 
 Policy (Policy &&policy) noexcept
 
Policyoperator= (Policy &&policy)
 
void setOwner (const std::string &owner)
 
std::string getOwner () const
 
void shareWithUsers (const std::vector< std::string > &users)
 
void removeUsers (const std::vector< std::string > &users)
 
std::vector< std::string > getSharedUsers () const
 
void enableReshare ()
 
void disableReshare ()
 
bool isReshareEnabled () const
 
void enableWatermarking ()
 
void disableWatermarking ()
 
bool isWatermarkingEnabled () const
 
void enablePrint ()
 
void disablePrint ()
 
bool isPrintEnabled () const
 
void enableCopy ()
 
void disableCopy ()
 
bool isCopyEnabled () const
 
void enablePersistentProtection ()
 
void disablePersistentProtection ()
 
bool isPersistentProtectionEnabled () const
 
void enablePreventDownload ()
 
void disablePreventDownload ()
 
bool isPreventDownloadEnabled () const
 
void expireInMins (unsigned mins)
 
void expireInDays (unsigned days)
 
void addExpiration (const std::string &expirationDate)
 
void removeExpiration ()
 
std::string getExpiration () const
 
std::string toString () const
 

Private Member Functions

std::string toJsonStringForKas () const
 
void applyPolicy (VirtruPolicyObject &policyObject) const
 
void enableOneClick ()
 
void disableOneClick ()
 

Private Attributes

friend Client
 
friend VirtruPolicyObject
 
std::unique_ptr< Impl > m_impl
 

Constructor & Destructor Documentation

virtru::Policy::Policy ( )

Constructor.

virtru::Policy::~Policy ( )

Destructor.

virtru::Policy::Policy ( const Policy policy)

Copy constructor.

virtru::Policy::Policy ( Policy &&  policy)
noexcept

Move copy constructor.

Member Function Documentation

void virtru::Policy::addExpiration ( const std::string &  expirationDate)

Access to the TDF data will be revoked for all users at the specified date. The owner will retain access after the expiration time is reached. The expiration date is specified in ISO-8601 format, and can include a time component. Ex: 2019-05-24T16:12:41Z

Parameters
expirationDate- Expiration date when the TDF will expire
void virtru::Policy::applyPolicy ( VirtruPolicyObject policyObject) const
private

Apply the policy control on to policyObject.

Parameters
policyObject- The VirtruPolicyObject.
void virtru::Policy::disableCopy ( )

Turns off copy policy control flag.

void virtru::Policy::disableOneClick ( )
private

Turns off one-click flag.

void virtru::Policy::disablePersistentProtection ( )

Turns off persistent protection policy control flag.

void virtru::Policy::disablePreventDownload ( )

Turns off prevent download policy control flag.

void virtru::Policy::disablePrint ( )

Turns off print policy control flag.

void virtru::Policy::disableReshare ( )

Turns off reshare policy control flag.

void virtru::Policy::disableWatermarking ( )

Turns off watermarking policy control flag.

void virtru::Policy::enableCopy ( )

Turns on copy policy control flag.

void virtru::Policy::enableOneClick ( )
private

Turns on one-click flag.

void virtru::Policy::enablePersistentProtection ( )

Turns on persistent protection policy control flag.

void virtru::Policy::enablePreventDownload ( )

Turns on prevent download policy control flag.

void virtru::Policy::enablePrint ( )

Turns on print policy control flag.

void virtru::Policy::enableReshare ( )

Turns on reshare policy control flag.

void virtru::Policy::enableWatermarking ( )

Turns on watermarking policy control flag.

void virtru::Policy::expireInDays ( unsigned  days)

Set the expiration in days
Access to the TDF data will be revoked for all users in the number of days specified, starting from the time this call is made. The owner will retain access after the expiration time is reached.

Parameters
days- days until expiration
void virtru::Policy::expireInMins ( unsigned  mins)

Set the expiration in minutes
Access to the TDF data will be revoked for all users in the number of minutes specified, starting from the time this call is made. The owner will retain access after the expiration time is reached.

Parameters
mins- minutes until expiration
std::string virtru::Policy::getExpiration ( ) const

Return the expiration time(in ISO-8601 format) of the TDF.

Returns
string - The expiration time(in ISO-8601 format) of the TDF. NOTE: If the expiration is not set, an empty string is return.
std::string virtru::Policy::getOwner ( ) const

Return the owner of the TDF.

Returns
owner - The owner's email address. NOTE: If the owner is not set, an empty string is return.
std::vector<std::string> virtru::Policy::getSharedUsers ( ) const

Return all the user who have access to the TDF.

Returns
users - All the user who have access to the TDF.
bool virtru::Policy::isCopyEnabled ( ) const

Return the status of 'Copy' control flag.

Returns
bool - True, if 'Copy' control flag is set.
bool virtru::Policy::isPersistentProtectionEnabled ( ) const

Return the status of 'PersistenProtection' control flag.

Returns
bool - True, if 'PersistentProtection' control flag is set.
bool virtru::Policy::isPreventDownloadEnabled ( ) const

Return the status of 'PreventDownload' control flag.

Returns
bool - True, if 'PreventDownload' control flag is set.
bool virtru::Policy::isPrintEnabled ( ) const

Return the status of 'Print' control flag.

Returns
bool - True, if 'Print' control flag is set.
bool virtru::Policy::isReshareEnabled ( ) const

Return the status of 'Reshare' control flag.

Returns
bool - True, if 'Reshare' control flag is set.
bool virtru::Policy::isWatermarkingEnabled ( ) const

Return the status of 'Watermarking' control flag.

Returns
bool - True, if 'Watermarking' control flag is set.
Policy& virtru::Policy::operator= ( const Policy policy)

Assignment operator.

Policy& virtru::Policy::operator= ( Policy &&  policy)

Move assignment operator.

void virtru::Policy::removeExpiration ( )

Remove the expiration.

void virtru::Policy::removeUsers ( const std::vector< std::string > &  users)

Remove access to the TDF file/data for the users in the list

Parameters
users- Remove access to the TDF file/data for the users in the vector
void virtru::Policy::setOwner ( const std::string &  owner)

Set the owner of the TDF

Parameters
owner- The owner's email address NOTE: By default, the owner is the address that was used when the client instance was created. This method will change the owner to the specified email address for the instance.
void virtru::Policy::shareWithUsers ( const std::vector< std::string > &  users)

Add access to the TDF file/data for the users in the list

Parameters
users- Share the TDF with the users in the vector
std::string virtru::Policy::toJsonStringForKas ( ) const
private

Expresses the policy as a json string for KAS

Returns
- Json fomated string.
std::string virtru::Policy::toString ( ) const

Return the description of all the policy controls of the instance.

Returns
- A formated string of all the policy controls of the instance.

Member Data Documentation

friend virtru::Policy::Client
private
std::unique_ptr<Impl> virtru::Policy::m_impl
private
friend virtru::Policy::VirtruPolicyObject
private

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