![]() |
das2C
das core C utilities (v3)
|
Handle storing credentials during a Das2 session and optionally save them to a file. More...


Go to the source code of this file.
Data Structures | |
| struct | das_credential |
| A single credential. More... | |
| struct | DasCredMngr |
| Credentials manager Handles a list of login credentials and supplies these as needed for network operations. More... | |
Typedefs | |
| typedef bool(* | das_prompt) (const char *sServer, const char *sRealm, const char *sDataset, const char *sMessage, char *sUser, char *sPassword) |
| Function signature for swapping out the user-prompt for credentials acquisition. More... | |
Functions | |
| DAS_API char * | das_b64_encode (const unsigned char *data, size_t input_length, size_t *output_length) |
| Encode provided binary data as base64 characters in a new buffer. More... | |
| DAS_API int | CredMngr_addCred (DasCredMngr *pThis, const das_credential *pCred) |
| Manually add a credential to a credentials manager instead of prompting the user. More... | |
| DAS_API das_credential * | CredMngr_getCred (DasCredMngr *pThis, const char *sServer, const char *sRealm, const char *sDataset, bool bValidOnly) |
| Get direct memory access to a stored credential. More... | |
| DAS_API int | CredMngr_addUserPass (DasCredMngr *pThis, const char *sServer, const char *sRealm, const char *sDataset, const char *sUser, const char *sPass) |
| Manually add a credential to a credentials manager instead of prompting the user. More... | |
Handle storing credentials during a Das2 session and optionally save them to a file.
| DAS_API int CredMngr_addCred | ( | DasCredMngr * | pThis, |
| const das_credential * | pCred | ||
| ) |
Manually add a credential to a credentials manager instead of prompting the user.
Typically when the credentials manager does not have a password it needs it calls the prompt function that was set using CredMngr_setPrompt() or the built in command line prompter if no prompt function has been set.
| pThis | The credentials manager structure that will hold the new credential in RAM |
| pCred | The credential to add. If an existing credential matches this one except for the hash value, the new hash will overwrite the old one. |
| DAS_API das_credential* CredMngr_getCred | ( | DasCredMngr * | pThis, |
| const char * | sServer, | ||
| const char * | sRealm, | ||
| const char * | sDataset, | ||
| bool | bValidOnly | ||
| ) |
Get direct memory access to a stored credential.
Used by other functions to find a credential for a particular URL
| pThis | A credentials manager |
| sServer | The service end point (A URL without fragments or query params) |
| sRealm | The security realm |
| sDataset | If not NULL, the dataset parameter must equal this |
| bValidOnly | Only return valid credentials. Credentials are assmed valid unless |
| DAS_API int CredMngr_addUserPass | ( | DasCredMngr * | pThis, |
| const char * | sServer, | ||
| const char * | sRealm, | ||
| const char * | sDataset, | ||
| const char * | sUser, | ||
| const char * | sPass | ||
| ) |
Manually add a credential to a credentials manager instead of prompting the user.
This is a individual string version of CredMngr_addCred that calculates it's own base64 hash.
| pThis | The credentials manager structure that will hold the new credential in RAM |
| sServer | The resource URL including the path, but not including fragments or query parameters |
| sRealm | The security realm to which this credential shoud be supplied |
| sDataset | If not NULL, the value of the 'dataset=' parameter that must be present for this credential to apply |
| sUser | A user name |
| sPass | A plain-text password |