Public Member Functions | Static Public Member Functions | List of all members
Celartem::DjVu::SecurityProvider Class Referenceabstract

#include <djv_security.h>

Inheritance diagram for Celartem::DjVu::SecurityProvider:
Inheritance graph
[legend]

Public Member Functions

virtual bool isEnforced () const =0
 
virtual String getUserId () const =0
 
virtual PropertySetgetEditablePropSet ()=0
 
virtual const PropertySetgetPropSet () const =0
 
virtual PropertySetgetEditableUserPropSet (const String &inUserId=NullString)=0
 
virtual const PropertySetgetUserPropSet (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< StreamcreateDecryptionStream (Stream *inStream, size_t inStreamSize) const =0
 
virtual AutoPtr< StreamcreateEncryptionStream (Stream *inStream, u32 inSalt) const =0
 
virtual AutoPtr< ChunkencodeSINFChunk () const =0
 
virtual AutoPtr< SecurityProviderduplicate () 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< SecurityProvidercreatePWD1 (const String &inUserId)
 
static AutoPtr< SecurityProvidercreatePWD2 (const String &inUserId)
 
static AutoPtr< SecurityProvidercreatePXL4 (const String &inPixelSafeServerUrl, CredentialProvider *inCredProv)
 
- Static Public Member Functions inherited from Celartem::Referable
static void dumpDbgAllRefCount ()
 

Detailed Description

This class provide an access to the internal security information.

Member Function Documentation

virtual void Celartem::DjVu::SecurityProvider::clearUserPropSets ( )
pure virtual

Remove all the user property-sets.

virtual AutoPtr<Stream> Celartem::DjVu::SecurityProvider::createDecryptionStream ( Stream inStream,
size_t  inStreamSize 
) const
pure virtual

Create a new Stream with which you can access the decrypted chunk data.

Parameters
inStreamThe stream which contains the encrypted data.
inStreamSizeThe size of the stream.
Returns
Pointer to the newly created Stream instance.
virtual AutoPtr<Stream> Celartem::DjVu::SecurityProvider::createEncryptionStream ( Stream inStream,
u32  inSalt 
) const
pure virtual

Create a new Stream with which you can encrypt the chunk data.

Parameters
inStream
static AutoPtr<SecurityProvider> Celartem::DjVu::SecurityProvider::createPWD1 ( const String inUserId)
static

Create a new SecurityProvider instance of PWD1 for encrypting the resource.

Parameters
inUserIdThe default user Id. This is used when calling getEditableUserPropSet or getUserPropSet without any parameter.
Returns
Pointer to the newly created SecurityInfo instance.
static AutoPtr<SecurityProvider> Celartem::DjVu::SecurityProvider::createPWD2 ( const String inUserId)
static

Create a new SecurityProvider instance of PWD2 for encrypting the resource.

Parameters
inUserIdThe default user Id. This is used when calling getEditableUserPropSet or getUserPropSet without any parameter.
Returns
Pointer to the newly created SecurityInfo instance.
static AutoPtr<SecurityProvider> Celartem::DjVu::SecurityProvider::createPXL4 ( const String inPixelSafeServerUrl,
CredentialProvider inCredProv 
)
static

Create a new SecurityProvider instance of PXL4 for encrypting the resource.

Parameters
inPixelSafeServerUrlUrl of the PixelSafe Protocol 4.X server. This implementation is not compatible to PixelSafe 2.X protocol and cannot communicate with 2.X servers.
inCredProvPointer to a CredentialProvider instance which provides the credentials to authenticate the user.
Returns
Pointer to the newly created SecurityInfo instance.
virtual AutoPtr<SecurityProvider> Celartem::DjVu::SecurityProvider::duplicate ( ) const
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.

Returns
Pointer to the newly created SecurityProvider instance.
virtual AutoPtr<Chunk> Celartem::DjVu::SecurityProvider::encodeSINFChunk ( ) const
pure virtual

Create SINF chunk from the security information gathered into this instance.

Returns
Pointer to the newly created SINF chunk.
virtual void Celartem::DjVu::SecurityProvider::getAssociatedUserList ( SimpleArray< String > &  outUserList) const
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.

Parameters
outUserListA SimpleArray<String> instance which receives the list of users.
virtual void Celartem::DjVu::SecurityProvider::getAvailableUserList ( SimpleArray< String > &  outUserList) const
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.

Parameters
outUserListA SimpleArray<String> instance which receives the list of users.
virtual PropertySet* Celartem::DjVu::SecurityProvider::getEditablePropSet ( )
pure virtual

Get the property-set which can be edited.

Returns
Pointer to the property-set.
virtual PropertySet* Celartem::DjVu::SecurityProvider::getEditableUserPropSet ( const String inUserId = NullString)
pure virtual

Get the user's property-set which can be edited.

Parameters
inUserIdUser to get property-set. NullString to get the current user's property-set.
Returns
Pointer to the property-set.
Time Celartem::DjVu::SecurityProvider::getExpiry ( const String inUserId = NullString) const

Get the expiry date of this document.

Parameters
inUserIdUser to determine the expiry. NullString for the current user.
Returns
Return the expiry date if exists; otherwise The t field of the returned Time instance is 0.
virtual size_t Celartem::DjVu::SecurityProvider::getNumOfUserPropSets ( ) const
pure virtual

Get the number of user property-sets.

Returns
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.

Parameters
inKeyA key of a property.
Returns
The value if the key exists; otherwise returns NullString.
virtual const PropertySet* Celartem::DjVu::SecurityProvider::getPropSet ( ) const
pure virtual

Get the property-set.

Returns
Pointer to the property-set.
virtual String Celartem::DjVu::SecurityProvider::getUserId ( ) const
pure virtual

Get the current user ID.

Returns
The user ID.
virtual const PropertySet* Celartem::DjVu::SecurityProvider::getUserPropSet ( const String inUserId = NullString) const
pure virtual

Get the user's property-set.

Parameters
inUserIdUser to get property-set. NullString to get the current user's property-set.
Returns
Pointer to the property-set.
bool Celartem::DjVu::SecurityProvider::hasExpiry ( const String inUserId = NullString) const

Determines whether the document has expiry.

Returns
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.

Parameters
inPriProOne of PredefinedPrivilegesAndProperties enumeration values which specify a privilege or a property.
inUserIdUser to determine the property. NullString for the current user.
virtual bool Celartem::DjVu::SecurityProvider::isEnforced ( ) const
pure virtual

Determine whether the security is enforced or not.

Returns
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.

Parameters
inUserIdUser 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.

Parameters
inPriProOne of PredefinedPrivilegesAndProperties enumeration values which specify a privilege.
inUserIdUser to determine the privilege. NullString for the current user.
virtual bool Celartem::DjVu::SecurityProvider::isUserAssociated ( const String inUserId) const
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.

Parameters
inUserIdUser to determine the existence.
Returns
true if associated; otherwise false.
virtual void Celartem::DjVu::SecurityProvider::removeUserPropSet ( const String inUserId)
pure virtual

Remove a user property-set.

Parameters
inUserIdUser 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.

Parameters
inPriProOne of PredefinedPrivilegesAndProperties enumeration values which specify a privilege.
inUserIdUser to determine the privilege. NullString for the current user.

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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:07.
Cuminas Logo