credential_to_handle()

Retrieve a handle representation of the credential.

Synopsis:

#include <sys/credential/credential_store.h>
 
int credential_to_handle(const credential_t *cred,
                         unsigned char **handle,
                         size_t *handle_sz)

Since:

BlackBerry 10.3.1

Arguments:

cred

The credential to convert to a handle.

handle

On return, a pointer to buffer that contains credential handle. You must call credential_util_free() to release this buffer when you're done using it.

handle_sz

On return, the size (in bytes) of the buffer that contains credential handle.

Library:

libcredential (For the qcc command, use the -l bps option to link against this library)

Description:

This function retrieves an opaque handle that uniquely identifies the given credential. The handle is returned in a newly allocated buffer.

The handle is an opaque buffer that can be used to:
  • save a reference to the credential in offline storage
  • pass a reference to the credential over the wire
  • pass a reference to the credential through components that are unaware of Credential Manager

Returns:

0 if operation was successful, error code otherwise.