2.5 Reading Shared Application or Credential Secrets

  1. For each user-defined application thread involved in secrets sharing, call NSSSCreateSHSHandle to obtain a void pointer as a handle to parse subsequent calls.

  2. Call NSSSReadSharedSecret to pass the handle and a user-populated SS_SH_SECRET_ID_T structure containing the shared secret type, name, and length.

    NOTE:You also pass the populated SSS_CONTEXT_T and SS_OBJECT_DN_T structures; ssFlags; and the SS_PWORD_T, SSS_READEXT_T, and SS_EXT_T structures that are normally passed into the call to NSSSReadSecret. Consequently, NSSReadSharedSecret enables you to call trees and user DNs outside of the primary connection.

  3. Internally, NSSSReadSharedSecret calls NSSSReadSecret to retrieve secret data stored on SecretStore. This function contains the handle and pointers to internally allocated key and value buffers.

    1. The internal secret data is parsed according to the shared secret format using the parsing library.

    2. Sequential internal calls are made to enter key and value data into a linked list.

  4. Call NSSSGetNextSHSEntry sequentially. This function returns the handle, the unsigned long context flag from the user-populated SSS_CONTEXT_T structure passed into NSSSReadSharedSecret, and pointers to user-allocated key value buffer and length parameters.

  5. Use the data returned for application-specific tasks.

  6. Before exiting the application, call NSSSDestroySHSHandle to free memory associated with the handle of each shared secret thread.