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.
6 /* From private/ppb_platform_verification_private.idl,
7 * modified Fri Oct 18 15:02:09 2013.
10 #ifndef PPAPI_C_PRIVATE_PPB_PLATFORM_VERIFICATION_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_PLATFORM_VERIFICATION_PRIVATE_H_
13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_completion_callback.h"
15 #include "ppapi/c/pp_instance.h"
16 #include "ppapi/c/pp_macros.h"
17 #include "ppapi/c/pp_resource.h"
18 #include "ppapi/c/pp_stdint.h"
19 #include "ppapi/c/pp_var.h"
21 #define PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE_0_2 \
22 "PPB_PlatformVerification_Private;0.2"
23 #define PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE \
24 PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE_0_2
28 * This file defines the API for platform verification. Currently, it only
34 * @addtogroup Interfaces
38 * The <code>PPB_PlatformVerification_Private</code> interface allows authorized
39 * services to verify that the underlying platform is trusted. An example of a
40 * trusted platform is a Chrome OS device in verified boot mode.
42 struct PPB_PlatformVerification_Private_0_2
{
44 * Create() creates a <code>PPB_PlatformVerification_Private</code> object.
46 * @pram[in] instance A <code>PP_Instance</code> identifying one instance of
49 * @return A <code>PP_Resource</code> corresponding to a
50 * <code>PPB_PlatformVerification_Private</code> if successful, 0 if creation
53 PP_Resource (*Create
)(PP_Instance instance
);
55 * IsPlatformVerification() determines if the provided resource is a
56 * <code>PPB_PlatformVerification_Private</code>.
58 * @param[in] resource A <code>PP_Resource</code> corresponding to a
59 * <code>PPB_PlatformVerification_Private</code>.
61 * @return <code>PP_TRUE</code> if the resource is a
62 * <code>PPB_PlatformVerification_Private</code>, <code>PP_FALSE</code> if the
63 * resource is invalid or some type other than
64 * <code>PPB_PlatformVerification_Private</code>.
66 PP_Bool (*IsPlatformVerification
)(PP_Resource resource
);
68 * Requests a platform challenge for a given service id.
70 * @param[in] service_id A <code>PP_Var</code> of type
71 * <code>PP_VARTYPE_STRING</code> containing the service_id for the challenge.
73 * @param[in] challenge A <code>PP_Var</code> of type
74 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the challenge data.
76 * @param[out] signed_data A <code>PP_Var</code> of type
77 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the data signed by the
80 * @param[out] signed_data_signature A <code>PP_Var</code> of type
81 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the signature of the
84 * @param[out] platform_key_certificate A <code>PP_Var</code> of type
85 * <code>PP_VARTYPE_STRING</code> that contains the device specific
86 * certificate for the requested service_id.
88 * @param[in] callback A <code>PP_CompletionCallback</code> to be called after
89 * the platform challenge has been completed. This callback will only run if
90 * the return code is <code>PP_OK_COMPLETIONPENDING</code>.
92 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
94 int32_t (*ChallengePlatform
)(PP_Resource instance
,
95 struct PP_Var service_id
,
96 struct PP_Var challenge
,
97 struct PP_Var
* signed_data
,
98 struct PP_Var
* signed_data_signature
,
99 struct PP_Var
* platform_key_certificate
,
100 struct PP_CompletionCallback callback
);
103 typedef struct PPB_PlatformVerification_Private_0_2
104 PPB_PlatformVerification_Private
;
109 #endif /* PPAPI_C_PRIVATE_PPB_PLATFORM_VERIFICATION_PRIVATE_H_ */