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

/** @file IPrivacyPreservingID.idl */

/** @cond */
interface IPrivacyPreservingID {
/** @endcond */

  /**
    @addtogroup IPrivacyPreservingID
    @{
   */

  /** @cond */

  error ERROR_FEATURE_NOT_LICENSED; /**< Feature is not licensed under PFM */
  error ERROR_LICENSE_UNAVAILABLE;  /**< Unable to access PFM license */

  /** @endcond */

  /**
    Get a 32-byte privacy preserving chipset ID \n
    The ID will be computed as: \n
    SHA256(ChipID || SerialNumber || salt || Credentials) \n
    - ChipID is common to all devices in the chipset family \n
    - Salt is supplied by the client \n
    - SerialNumber is unique to the device \n
    - Credentials will be parsed from the caller and computed as follows: \n
      - If the client is a Trusted App \n
        - Credentials = DistID \n
      - If the client is an Android vendor daemon \n
        - Credentials = SHA256(vmid || uid) \n
      - If the client is an APK \n
        - Credentials = SHA256(vmid || PackageCert)

    @param [in] salt  Salt provided by client
    @param [out] id   32-byte client specific device ID

    @return
    Object_OK on success \n
    ERROR_FEATURE_NOT_LICENSED if this feature is not enabled in PFM license \n
    ERROR_LICENSE_UNAVAILABLE if PFM license cannot be accessed
   */
  method getDeviceID(in buffer salt, out buffer id);

  /**
    Get a 32-byte privacy preserving chipset ID \n
    This method can only be invoked by QTI signed TAs
    The ID will be computed as: \n
    SHA256(ChipID || SerialNumber || salt || Credentials) \n
    - ChipID is common to all devices in the chipset family \n
    - Salt is supplied by the client \n
    - SerialNumber is unique to the device \n
    - Credentials will be parsed from the caller and computed as follows: \n
      - If the client is a Trusted App \n
        - Credentials = DistID \n
      - If the client is an Android vendor daemon \n
        - Credentials = SHA256(vmid || uid) \n
      - If the client is an APK \n
        - Credentials = SHA256(vmid || PackageCert)

    @param [in] credentials  Credentials for the client using this API
    @param [in] salt         Salt provided by client
    @param [out] id          32-byte client specific device ID

    @return
    Object_OK on success
   */
  method getClientDeviceID(in interface credentials, in buffer salt, out buffer id);

  /** @} */ /* end_addtogroup IPrivacyPreservingID */
};
