#include <djv_security.h>
Public Member Functions | |
virtual bool | isEnforced () const =0 |
virtual String | getUserId () const =0 |
virtual PropertySet * | getEditablePropSet ()=0 |
virtual const PropertySet * | getPropSet () const =0 |
virtual PropertySet * | getEditableUserPropSet (const String &inUserId=NullString)=0 |
virtual const PropertySet * | getUserPropSet (const String &inUserId=NullString) const =0 |
virtual void | getAssociatedUserList (SimpleArray< String > &outUserList) const =0 |
virtual bool | isUserAssociated (const String &inUserId) const =0 |
virtual void | getAvailableUserList (SimpleArray< String > &outUserList) const =0 |
virtual void | removeUserPropSet (const String &inUserId)=0 |
virtual void | clearUserPropSets ()=0 |
virtual size_t | getNumOfUserPropSets () const =0 |
virtual AutoPtr< Stream > | createDecryptionStream (Stream *inStream, size_t inStreamSize) const =0 |
virtual AutoPtr< Stream > | createEncryptionStream (Stream *inStream, u32 inSalt) const =0 |
virtual AutoPtr< Chunk > | encodeSINFChunk () const =0 |
virtual AutoPtr< SecurityProvider > | duplicate () const =0 |
String | getPropFallback (const String &inKey, const String &inUserId=NullString) const |
bool | isEnabled (PredefinedPrivilegesAndProperties inPriPro, const String &inUserId=NullString) const |
bool | isPermitted (PredefinedPrivilegesAndProperties inPriPro, const String &inUserId=NullString) const |
void | throwIfNoPermission (PredefinedPrivilegesAndProperties inPriPro, const String &inUserId=NullString) const |
bool | hasExpiry (const String &inUserId=NullString) const |
Time | getExpiry (const String &inUserId=NullString) const |
bool | isExpired (const String &inUserId=NullString) const |
Public Member Functions inherited from Celartem::Referable | |
Referable () | |
void | addRef () const |
void | releaseRef () const |
size_t | getReferenceCount () const |
Static Public Member Functions | |
static AutoPtr< SecurityProvider > | createPWD1 (const String &inUserId) |
static AutoPtr< SecurityProvider > | createPWD2 (const String &inUserId) |
static AutoPtr< SecurityProvider > | createPXL4 (const String &inPixelSafeServerUrl, CredentialProvider *inCredProv) |
Static Public Member Functions inherited from Celartem::Referable | |
static void | dumpDbgAllRefCount () |
This class provide an access to the internal security information.
|
pure virtual |
Remove all the user property-sets.
|
pure virtual |
Create a new Stream with which you can encrypt the chunk data.
inStream |
|
static |
Create a new SecurityProvider instance of PWD1
for encrypting the resource.
inUserId | The default user Id. This is used when calling getEditableUserPropSet or getUserPropSet without any parameter. |
|
static |
Create a new SecurityProvider instance of PWD2
for encrypting the resource.
inUserId | The default user Id. This is used when calling getEditableUserPropSet or getUserPropSet without any parameter. |
|
static |
Create a new SecurityProvider instance of PXL4
for encrypting the resource.
inPixelSafeServerUrl | Url of the PixelSafe Protocol 4.X server. This implementation is not compatible to PixelSafe 2.X protocol and cannot communicate with 2.X servers. |
inCredProv | Pointer to a CredentialProvider instance which provides the credentials to authenticate the user. |
|
pure virtual |
Duplicate the SecurityProvider instance.
This method is useful when you inherit a SecurityProvider instance to serialize the Secure DjVu to a new file.
Create SINF
chunk from the security information gathered into this instance.
SINF
chunk.
|
pure virtual |
Get the list of the users, who have a permission entry on this document.
This method fails if you don't have sufficient privilege.
outUserList | A SimpleArray<String> instance which receives the list of users. |
|
pure virtual |
Get the list of available users.
This method gathers the full list of the users, which can be obtained with your privileges. Please note that there might be users who you cannot obtain with this method. This method fails if you don't have sufficient privileges.
outUserList | A SimpleArray<String> instance which receives the list of users. |
|
pure virtual |
Get the property-set which can be edited.
|
pure virtual |
Get the user's property-set which can be edited.
inUserId | User to get property-set. NullString to get the current user's property-set. |
Get the expiry date of this document.
inUserId | User to determine the expiry. NullString for the current user. |
|
pure virtual |
Get the number of user property-sets.
String Celartem::DjVu::SecurityProvider::getPropFallback | ( | const String & | inKey, |
const String & | inUserId = NullString |
||
) | const |
Get the property from both of global and user property-sets.
This method firstly tries to get the specified property from the global one, which is obtained by getPropSet method and then tries to get the same one from the user ones.
inKey | A key of a property. |
|
pure virtual |
Get the property-set.
|
pure virtual |
Get the current user ID.
|
pure virtual |
Get the user's property-set.
inUserId | User to get property-set. NullString to get the current user's property-set. |
bool Celartem::DjVu::SecurityProvider::hasExpiry | ( | const String & | inUserId = NullString | ) | const |
Determines whether the document has expiry.
true
if this document has expiry; otherwise false
. bool Celartem::DjVu::SecurityProvider::isEnabled | ( | PredefinedPrivilegesAndProperties | inPriPro, |
const String & | inUserId = NullString |
||
) | const |
Determine whether the specified property is enabled or not.
Actual security enforcement status is determined by isEnforced method and you should use isPermitted method to determine whether an user can (or cannot) do the things.
inPriPro | One of PredefinedPrivilegesAndProperties enumeration values which specify a privilege or a property. |
inUserId | User to determine the property. NullString for the current user. |
|
pure virtual |
Determine whether the security is enforced or not.
true
if the security is enforced; otherwise false
. bool Celartem::DjVu::SecurityProvider::isExpired | ( | const String & | inUserId = NullString | ) | const |
Determine whether the document is expired or not.
This method checks both document-level and user-level expiries.
inUserId | User to determine the expiry. NullString for the current user. |
bool Celartem::DjVu::SecurityProvider::isPermitted | ( | PredefinedPrivilegesAndProperties | inPriPro, |
const String & | inUserId = NullString |
||
) | const |
Determine whether an user has the specified privilege or not.
This method is used to determine the actual security enforcement and not a method to determine a property status.
inPriPro | One of PredefinedPrivilegesAndProperties enumeration values which specify a privilege. |
inUserId | User to determine the privilege. NullString for the current user. |
|
pure virtual |
Determine whether a specified user has a permission entry on this document or not.
This method fails if you don't have sufficient privileges.
inUserId | User to determine the existence. |
true
if associated; otherwise false
.
|
pure virtual |
Remove a user property-set.
inUserId | User to remove his (her) property-set. |
void Celartem::DjVu::SecurityProvider::throwIfNoPermission | ( | PredefinedPrivilegesAndProperties | inPriPro, |
const String & | inUserId = NullString |
||
) | const |
Throws an exception of errInvalidParam if no permission for the specified privilege.
inPriPro | One of PredefinedPrivilegesAndProperties enumeration values which specify a privilege. |
inUserId | User to determine the privilege. NullString for the current user. |