Public Types | Public Member Functions | Static Public Member Functions | List of all members
Celartem::CredentialProvider Class Referenceabstract

#include <cel_credprovider.h>

Inheritance diagram for Celartem::CredentialProvider:
Inheritance graph
[legend]

Public Types

enum  GetCredentialFlag
 

Public Member Functions

virtual AutoPtr< CredentialInfogetCredential (AuthTargetType inAuthTargetType, const String &inAuthTarget, u32 inFlags=0)=0
 
- Public Member Functions inherited from Celartem::Referable
 Referable ()
 
void addRef () const
 
void releaseRef () const
 
size_t getReferenceCount () const
 

Static Public Member Functions

static AutoPtr
< CredentialProvider
createFromStrings (const String &inUserName, const String &inPassword, const String &inTarget=NullString)
 
static AutoPtr
< CredentialProvider
create (void *inParentHandle, const String &inCaption, const String &inMessage=NullString, unsigned long inFlags=0)
 
- Static Public Member Functions inherited from Celartem::Referable
static void dumpDbgAllRefCount ()
 

Detailed Description

CredentialProvider defines the interface of retrieving credential information. All PixelLive/PixelSafe functions which handle the credential information use this class. You can create your own CredentialProvider classes that bridges the your GUI/CUI codes that interacts with the users to this library. For the most easiest case, if an application already has the user name and password in plain string, use createFromStrings function to create CredentialProvider instance. For more information about CredentialProvider or authentication, see authToDoc.

Member Enumeration Documentation

Note that CredentialProvider implementation can ignore these flags and they are just advisary.

Member Function Documentation

static AutoPtr<CredentialProvider> Celartem::CredentialProvider::create ( void *  inParentHandle,
const String inCaption,
const String inMessage = NullString,
unsigned long  inFlags = 0 
)
static

This function creates a GUI version of CredentialProvider instance. If getCredential method is called, the instance shows some dialog that prompts the user to input his user name and password.
Currently, this function is only provided on the following platforms:

  • Windows XP
  • Windows Server 2003 SP1/R2
  • Windows Vista
    Parameters
    inParentHandlePlatform dependent parent window handle. On windows, this is HWND.
    inCaptionThe caption for the dialog.
    inMessageThe message for the dialog. If this is NullString, the GUI shows the inAuthTarget passed to getCredential method.
    inFlagsReserved. It must be 0.
    Returns
    Pointer to the newly created CredentialProvider instance.
static AutoPtr<CredentialProvider> Celartem::CredentialProvider::createFromStrings ( const String inUserName,
const String inPassword,
const String inTarget = NullString 
)
static

This function creates a CredentialProvider instance from the pair of user name and password.
The CredentialProvider instance created by the function internally uses SecureString to preserve the information and it is more secure than preserving username and password in plain text.

Parameters
inUserNameThe user name.
inPasswordThe password for the user name.
inTargetThe target of this credential information.
Returns
Pointer to the newly created CredentialProvider instance.

The following code illustrates how to use this function in your code:

char username[256], password[256];
// Prompt user to input the information.
// You should check the risks of buffer overrun.
inputDialog(username, sizeof(username), password, sizeof(password));
AutoPtr<CredentialProvider> credProv = createFromStrings(username, password);
// zero-clearing buffers to reduce security risks
memset(username, sizeof(username));
memset(password, sizeof(password));
See Also
SecureString
virtual AutoPtr<CredentialInfo> Celartem::CredentialProvider::getCredential ( AuthTargetType  inAuthTargetType,
const String inAuthTarget,
u32  inFlags = 0 
)
pure virtual

This method returns a CredentialInfo instance that holds the credential for the specified target. The way the method actually retrieves the credential is not defined; it may show some dialog to prompt the user to input his User name and password or it may load the information from private credential store such as key-chain or something like it.

Parameters
inAuthTargetTypeOne of the AuthTargetType enumeration value.
inAuthTargetHuman readable string that uniquely identifies the authentication target. The actual value of this parameter is defined by inAuthTargetType:
  • authHttpBasic
    The URL of the resource.
  • authHttpProxy
    The address of the proxy server; it may be dotted-decimal notation of the IP address or human readable host name.
  • authPixelSafe2Local
    The GUID of the PFZ file in String.
  • authPixelSafe2
    The address of the PixelSafe server.
  • authPixelSafe3
    This value is not used with the current implementation.
  • authUnknown
    Some unique identifier of the server or resource.
inFlagsAny combination of GetCredentialFlag enumeration values.
Returns
Pointer to the newly created CredentialInfo instance. If this method fails to obtain the credential for the specified target, it returns NULL.
See Also
CredentialInfo

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:06.
Cuminas Logo