- add sources.
[platform/framework/web/crosswalk.git] / src / ppapi / api / private / ppb_platform_verification_private.idl
1 /* Copyright 2013 The Chromium Authors. All rights reserved.
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5
6 /**
7  * This file defines the API for platform verification. Currently, it only
8  * supports Chrome OS.
9  */
10
11 [generate_thunk]
12
13 label Chrome {
14   M32 = 0.2
15 };
16
17 /**
18  * The <code>PPB_PlatformVerification_Private</code> interface allows authorized
19  * services to verify that the underlying platform is trusted. An example of a
20  * trusted platform is a Chrome OS device in verified boot mode.
21  */
22
23 interface PPB_PlatformVerification_Private {
24   /**
25    * Create() creates a <code>PPB_PlatformVerification_Private</code> object.
26    *
27    * @pram[in] instance A <code>PP_Instance</code> identifying one instance of
28    * a module.
29    *
30    * @return A <code>PP_Resource</code> corresponding to a
31    * <code>PPB_PlatformVerification_Private</code> if successful, 0 if creation
32    * failed.
33    */
34   PP_Resource Create([in] PP_Instance instance);
35
36   /**
37    * IsPlatformVerification() determines if the provided resource is a
38    * <code>PPB_PlatformVerification_Private</code>.
39    *
40    * @param[in] resource A <code>PP_Resource</code> corresponding to a
41    * <code>PPB_PlatformVerification_Private</code>.
42    *
43    * @return <code>PP_TRUE</code> if the resource is a
44    * <code>PPB_PlatformVerification_Private</code>, <code>PP_FALSE</code> if the
45    * resource is invalid or some type other than
46    * <code>PPB_PlatformVerification_Private</code>.
47    */
48   PP_Bool IsPlatformVerification([in] PP_Resource resource);
49
50   /**
51    * Requests a platform challenge for a given service id.
52    *
53    * @param[in] service_id A <code>PP_Var</code> of type
54    * <code>PP_VARTYPE_STRING</code> containing the service_id for the challenge.
55    *
56    * @param[in] challenge A <code>PP_Var</code> of type
57    * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the challenge data.
58    *
59    * @param[out] signed_data A <code>PP_Var</code> of type
60    * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the data signed by the
61    * platform.
62    *
63    * @param[out] signed_data_signature A <code>PP_Var</code> of type
64    * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the signature of the
65    * signed data block.
66    *
67    * @param[out] platform_key_certificate A <code>PP_Var</code> of type
68    * <code>PP_VARTYPE_STRING</code> that contains the device specific
69    * certificate for the requested service_id.
70    *
71    * @param[in] callback A <code>PP_CompletionCallback</code> to be called after
72    * the platform challenge has been completed. This callback will only run if
73    * the return code is <code>PP_OK_COMPLETIONPENDING</code>.
74    *
75    * @return An int32_t containing an error code from <code>pp_errors.h</code>.
76    */
77   int32_t ChallengePlatform(
78       [in] PP_Resource instance,
79       [in] PP_Var service_id,
80       [in] PP_Var challenge,
81       [out] PP_Var signed_data,
82       [out] PP_Var signed_data_signature,
83       [out] PP_Var platform_key_certificate,
84       [in] PP_CompletionCallback callback);
85 };