This section contains the general DataVaccinator Client API calls. More...
Typedefs | |
typedef int32_t(* | dvIndexCb) (void *usrCtx, const char *vid, const char *data, ruList *indexWords) |
Functions | |
DVAPI int32_t | dvAddIndexWord (ruList *indexWords, const char *appId, const char *word) |
DVAPI int32_t | dvAddSearchWord (ruList *searchWords, const char *appId, const char *word) |
DVAPI int32_t | dvAdd (dvCtx dc, const char *data, ruList indexWords, char **vid) |
DVAPI int32_t | dvUpdate (dvCtx dc, const char *vid, const char *data, ruList indexWords) |
DVAPI int32_t | dvGet (dvCtx dc, ruList vids, ruMap *vidMap) |
DVAPI int32_t | dvGetVid (ruMap vidMap, const char *vid, char **pid) |
DVAPI int32_t | dvSearch (dvCtx dc, ruList searchWords, ruList *vids) |
DVAPI int32_t | dvDelete (dvCtx dc, ruList vids) |
DVAPI int32_t | dvWipe (dvCtx dc, ruList vids) |
DVAPI int32_t | dvChangeAppId (dvCtx dc, const char *newId, ruList vids, ruMap *vidMap, dvIndexCb indexCb, void *indexCtx) |
This section contains the general DataVaccinator Client API calls.
typedef int32_t(* dvIndexCb) (void *usrCtx, const char *vid, const char *data, ruList *indexWords) |
A function that generates a list of index word entries based on the given PID.
usrCtx | Opaque context to be passed to the function. |
vid | The VID that represents the given PID data. This is supplied in case it is useful. |
data | The PID data to vaccinate and extract index word entries from. |
indexWords | Where the ruList of index word entries should be stored. The returned ruList will be freed with ruListFree when no longer needed. |
Creates a new PID entry in the DataVaccinator Vault.
dc | The dvCtx to work with. |
data | The PID data to vaccinate. |
indexWords | Optional index word terms under which this data should be found via dvSearch. Use NULL for none. |
vid | Where the corresponding VID for the given data will be stored on success. Free this with ruFree when done with it. |
DVAPI int32_t dvAddIndexWord | ( | ruList * | indexWords, |
const char * | appId, | ||
const char * | word | ||
) |
Adds the given word as an index word to the referenced ruList. This function is used when PID is sent to the DataVaccinator Vault with the functions dvAdd and dvUpdate. For making search word terms use dvAddSearchWord instead.
indexWords | Pointer to an ruList that the index word will be added to. This list will be created if NULL, otherwise the given term will be added to the list present. The list must be freed with ruListFree when done with it. |
appId | The app-id to use for term hashing. |
word | index word under which data should be found via dvSearch. |
DVAPI int32_t dvAddSearchWord | ( | ruList * | searchWords, |
const char * | appId, | ||
const char * | word | ||
) |
Adds the given word as a search word to the referenced ruList. This function is used when searching for matching PID data with dvSearch .
searchWords | Pointer to an ruList that the search word will be added to. This list will be created if NULL, otherwise the given term will be added to the list present. The list must be freed with ruListFree when done with it. |
appId | The app-id to use for term hashing. |
word | search word under which VID entries should be found via dvSearch. |
DVAPI int32_t dvChangeAppId | ( | dvCtx | dc, |
const char * | newId, | ||
ruList | vids, | ||
ruMap * | vidMap, | ||
dvIndexCb | indexCb, | ||
void * | indexCtx | ||
) |
This function re-encrypts all given VID references with the app-id given in newId.
This may be needed if a user's app-id has been changed as a result of a compromise due to a leakage. Be sure to iterate over the returned VID Map.
dc | The dvCtx with the old app-id to work with. |
newId | The new app-id to re-encrypt each PID entry with. |
vids | The list of VID entries that need re-encrypting. |
vidMap | Where the returned VID Map will be stored. It is good practice to iterate over the given list of VID entries and to use dvGetVid to check their stati. |
indexCb | An optional dvIndexCb to call to set index word terms of each re-encrypted PID entry. |
indexCtx | An optional context that will be passed into indexCb as the usrCtx parameter. |
This example to change the app-id can also be found in examples/changeappid.c:
Deletes given list of VID entries from the DataVaccinator Vault.
Retrieves a VID Map for the given list of VID entries.
dc | The dvCtx to work with. |
vids | An ruList of VID entries to retrieve the VID Map for. |
vidMap | Where the returned VID Map will be stored. It is good practice to iterate over the given list of VID entries and to use dvGetVid to retrieve its entries. |
DVAPI int32_t dvGetVid | ( | ruMap | vidMap, |
const char * | vid, | ||
char ** | pid | ||
) |
Retrieves the associated PID data for given VID from the given VID Map and returns its associated status code.
vidMap | The VID Map to retrieve the value from. |
vid | VID entry to retrieve. |
pid | Where to store the returned PID data. This data should be copied and must not be freed. It is freed along with the vidMap. |
Retrieves an ruList of VID entries that matched the given search word entries.
dc | The dvCtx to work with. |
searchWords | An ruList of previously in dvAddSearchWord specified search word terms to query. These terms are ANDed. |
vids | Where the ruList of found VID values will be stored. The returned ruList should be freed with ruListFree when no longer needed. The individual list entries may need to be copied as they are freed along with the list. |
Updates an existing PID entry in the DataVaccinator Vault with new PID.
dc | The dvCtx to work with. |
vid | The VID whose data to update. |
data | The PID to update it with. |
indexWords | Optional index word terms under which this data should be found via dvSearch. Use NULL for none. |