// Copyright (c) 2015 Qualcomm Technologies, Inc.  All Rights Reserved.
// Qualcomm Technologies Proprietary and Confidential.

/** @cond */
interface ICredentials {
/** @endcond */

  /**
   * @addtogroup ICredentials
   * @{
   */

  /** @cond */
  /** No property was found with the requested index or name */
  error ERROR_NOT_FOUND;

  /** The buffer provided to receive the name was too small */
  error ERROR_NAME_SIZE;

  /** The buffer provided to receive the value was too small */
  error ERROR_VALUE_SIZE;
  /** @endcond */

  /**
    Gets the name of a property, given its position in the sequence of
    properties.

    @param[in]  index  A (zero-based) index into the set of properties.
    @param[out] name   Property name, including a terminating zero byte.
    @param[out] value  Property value, including a terminating zero byte.

    @return
    Object_OK -- Function returned successfully. \n
    ICredentials_ERROR_NAME_SIZE -- Supplied buffer not large enough to
                                    contain the name. \n
    ICredentials_ERROR_VALUE_SIZE -- Supplied buffer not large enough to
                                     contain the value. \n
    ICredentials_ERROR_NOT_FOUND -- No properties at given index.
  */
  method getPropertyByIndex(in uint32 index,
                            out buffer name,
                            out buffer value);

  /**
    Returns a property value, given a name.

    Note that <tt>name</tt> and <tt>value</tt> are buffer types, not strings.
    The <tt>name</tt> buffer does not contain any null terminating character.
    <tt>name</tt> length should be passed as the size of the buffer
    if <tt>name</tt> is a zero-terminated string.

    However, the <tt>value</tt> buffer will be populated with a
    terminating null byte and the resulting output length will be set to
    size, including the terminating null.

    @param[in]  name   Property name.
    @param[out] value  Property value, including a terminating zero byte.

    @return
    Object_OK -- Function returned successfully. \n
    ICredentials_ERROR_VALUE_SIZE -- Supplied buffer not large enough to
                                     contain value. \n
    ICredentials_ERROR_NOT_FOUND -- No properties found with given name.
  */
  method getValueByName(in buffer name,
                        out buffer value);
    /** @} */ /* end_addtogroup ICredentials */
};
