#include <cel_credprovider.h>

Public Types | |
| enum | GetCredentialFlag |
Public Member Functions | |
| virtual AutoPtr< CredentialInfo > | getCredential (AuthTargetType inAuthTargetType, const String &inAuthTarget, u32 inFlags=0)=0 |
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) |
Definition at line 103 of file cel_credprovider.h.
Note that CredentialProvider implementation can ignore these flags and they are just advisary.
Definition at line 110 of file cel_credprovider.h.
| 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.
| inAuthTargetType | One of the AuthTargetType enumeration value. | |
| inAuthTarget | Human readable string that uniquely identifies the authentication target. The actual value of this parameter is defined by inAuthTargetType:
| |
| inFlags | Any combination of GetCredentialFlag enumeration values. |
NULL. | 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.
| inUserName | The user name. | |
| inPassword | The password for the user name. | |
| inTarget | The target of this credential information. |
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));
| 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:
| inParentHandle | Platform dependent parent window handle. On windows, this is HWND. | |
| inCaption | The caption for the dialog. | |
| inMessage | The message for the dialog. If this is NullString, the GUI shows the inAuthTarget passed to getCredential method. | |
| inFlags | Reserved. It must be 0. |