Generic access to buffer
[NetIDMgr Credentials Database]


Detailed Description

Currently, credentials and identities both hold record data types. This set of API's allow an application to access fields in the records using a single interface. Note that credentials only accept regular attributes while identities can hold both attributes and properties.

Handles to credentials and identities are implicitly also handles to records. Thus they can be directly used as such.


Functions

KHMEXP khm_int32 KHMAPI kcdb_buf_get_attr (khm_handle record, khm_int32 attr_id, khm_int32 *attr_type, void *buffer, khm_size *pcb_buf)
 Get an attribute from a record by attribute id.
KHMEXP khm_int32 KHMAPI kcdb_buf_get_attrib (khm_handle record, const wchar_t *attr_name, khm_int32 *attr_type, void *buffer, khm_size *pcb_buf)
 Get an attribute from a record by name.
KHMEXP khm_int32 KHMAPI kcdb_buf_get_attr_string (khm_handle record, khm_int32 attr_id, wchar_t *buffer, khm_size *pcbbuf, khm_int32 flags)
 Get the string representation of a record attribute.
KHMEXP khm_int32 KHMAPI kcdb_buf_get_attrib_string (khm_handle record, const wchar_t *attr_name, wchar_t *buffer, khm_size *pcbbuf, khm_int32 flags)
 Get the string representation of a record attribute by name.
KHMEXP khm_int32 KHMAPI kcdb_buf_set_attr (khm_handle record, khm_int32 attr_id, void *buffer, khm_size cbbuf)
 Set an attribute in a record by attribute id.
KHMEXP khm_int32 KHMAPI kcdb_buf_set_attrib (khm_handle record, const wchar_t *attr_name, void *buffer, khm_size cbbuf)
 Set an attribute in a record by name.
KHMEXP khm_int32 KHMAPI kcdb_buf_hold (khm_handle record)
KHMEXP khm_int32 KHMAPI kcdb_buf_release (khm_handle record)


Function Documentation

KHMEXP khm_int32 KHMAPI kcdb_buf_get_attr ( khm_handle  record,
khm_int32  attr_id,
khm_int32 attr_type,
void *  buffer,
khm_size pcb_buf 
)

Get an attribute from a record by attribute id.

Parameters:
[in] buffer The buffer that is to receive the attribute value. Set this to NULL if only the required buffer size is to be returned.
[in,out] cbbuf The number of bytes available in buffer. If buffer is not sufficient, returns KHM_ERROR_TOO_LONG and sets this to the required buffer size.
[out] attr_type Receives the data type of the attribute. Set this to NULL if the type is not required.
Note:
Set both buffer and cbbuf to NULL if only the existence of the attribute is to be checked. If the attribute exists in this record then the function will return KHM_ERROR_SUCCESS, otherwise it returns KHM_ERROR_NOT_FOUND.

KHMEXP khm_int32 KHMAPI kcdb_buf_get_attr_string ( khm_handle  record,
khm_int32  attr_id,
wchar_t *  buffer,
khm_size pcbbuf,
khm_int32  flags 
)

Get the string representation of a record attribute.

A shortcut function which generates the string representation of a record attribute directly.

Parameters:
[in] record A handle to a record
[in] attr_id The attribute to retrieve
[out] buffer A pointer to a string buffer which receives the string form of the attribute. Set this to NULL if you only want to determine the size of the required buffer.
[in,out] pcbbuf A pointer to a khm_int32 that, on entry, holds the size of the buffer pointed to by buffer, and on exit, receives the actual number of bytes that were copied.
[in] flags Flags for the string conversion. Can be set to one of KCDB_TS_LONG or KCDB_TS_SHORT. The default is KCDB_TS_LONG.
Return values:
KHM_ERROR_SUCCESS Success
KHM_ERROR_NOT_FOUND The given attribute was either invalid or was not defined for this record
KHM_ERROR_INVALID_PARAM One or more parameters were invalid
KHM_ERROR_TOO_LONG Either buffer was NULL or the supplied buffer was insufficient

KHMEXP khm_int32 KHMAPI kcdb_buf_get_attrib ( khm_handle  record,
const wchar_t *  attr_name,
khm_int32 attr_type,
void *  buffer,
khm_size pcb_buf 
)

Get an attribute from a record by name.

Parameters:
[in] buffer The buffer that is to receive the attribute value. Set this to NULL if only the required buffer size is to be returned.
[in,out] cbbuf The number of bytes available in buffer. If buffer is not sufficient, returns KHM_ERROR_TOO_LONG and sets this to the required buffer size.
Note:
Set both buffer and cbbuf to NULL if only the existence of the attribute is to be checked. If the attribute exists in this record then the function will return KHM_ERROR_SUCCESS, otherwise it returns KHM_ERROR_NOT_FOUND.

KHMEXP khm_int32 KHMAPI kcdb_buf_get_attrib_string ( khm_handle  record,
const wchar_t *  attr_name,
wchar_t *  buffer,
khm_size pcbbuf,
khm_int32  flags 
)

Get the string representation of a record attribute by name.

A shortcut function which generates the string representation of a record attribute directly.

Parameters:
[in] record A handle to a record
[in] attrib The name of the attribute to retrieve
[out] buffer A pointer to a string buffer which receives the string form of the attribute. Set this to NULL if you only want to determine the size of the required buffer.
[in,out] pcbbuf A pointer to a khm_int32 that, on entry, holds the size of the buffer pointed to by buffer, and on exit, receives the actual number of bytes that were copied.
[in] flags Flags for the string conversion. Can be set to one of KCDB_TS_LONG or KCDB_TS_SHORT. The default is KCDB_TS_LONG.
See also:
kcdb_cred_get_attr_string()

KHMEXP khm_int32 KHMAPI kcdb_buf_set_attr ( khm_handle  record,
khm_int32  attr_id,
void *  buffer,
khm_size  cbbuf 
)

Set an attribute in a record by attribute id.

Parameters:
[in] cbbuf Number of bytes of data in buffer. The individual data type handlers may copy in less than this many bytes in to the record.

KHMEXP khm_int32 KHMAPI kcdb_buf_set_attrib ( khm_handle  record,
const wchar_t *  attr_name,
void *  buffer,
khm_size  cbbuf 
)

Set an attribute in a record by name.

Parameters:
[in] cbbuf Number of bytes of data in buffer. The individual data type handlers may copy in less than this many bytes in to the record.


Generated on Fri Aug 3 08:27:14 2007 for Network Identity Manager by Doxygen 1.5.2
© 2004-2007 Massachusetts Institute of Technology.
© 2005-2007 Secure Endpoints Inc.
Contact khimaira@mit.edu