Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: ppapi/c/private/ppb_flash_x509_certificate.h

Issue 9693024: Add the PPAPI X509 Certificate interface and implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /* Copyright (c) 2012 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 /* From private/ppb_flash_x509_certificate.idl,
7 * modified Wed Mar 14 15:08:23 2012.
8 */
9
10 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_
11 #define PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_
12
13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_instance.h"
15 #include "ppapi/c/pp_macros.h"
16 #include "ppapi/c/pp_resource.h"
17 #include "ppapi/c/pp_stdint.h"
18 #include "ppapi/c/pp_var.h"
19
20 #define PPB_FLASH_X509CERTIFICATE_INTERFACE_0_1 "PPB_Flash_X509Certificate;0.1"
21 #define PPB_FLASH_X509CERTIFICATE_INTERFACE \
22 PPB_FLASH_X509CERTIFICATE_INTERFACE_0_1
23
24 /**
25 * @file
26 * This file defines the <code>PPB_Flash_X509Certificate</code> interface for
27 * an X509 certificate.
28 */
29
30
31 /**
32 * @addtogroup Enums
33 * @{
34 */
35 /* TODO(raymes): Document the types of the return values for each of these
36 * fields as they are implemented. */
37 typedef enum {
38 PP_FLASH_X509CERTIFICATE_ISSUER_COMMON_NAME_ = 0,
39 PP_FLASH_X509CERTIFICATE_ISSUER_LOCALITY_NAME_ = 1,
40 PP_FLASH_X509CERTIFICATE_ISSUER_STATE_OR_PROVINCE_NAME_ = 2,
41 PP_FLASH_X509CERTIFICATE_ISSUER_COUNTRY_NAME_ = 3,
42 PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_NAME_ = 4,
43 PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_UNIT_NAME_ = 5,
44 PP_FLASH_X509CERTIFICATE_ISSUER_UNIQUE_ID_ = 6,
45 PP_FLASH_X509CERTIFICATE_PRINCIPAL_COMMON_NAME_ = 7,
46 PP_FLASH_X509CERTIFICATE_PRINCIPAL_LOCALITY_NAME_ = 8,
47 PP_FLASH_X509CERTIFICATE_PRINCIPAL_STATE_OR_PROVINCE_NAME_ = 9,
48 PP_FLASH_X509CERTIFICATE_PRINCIPAL_COUNTRY_NAME_ = 10,
49 PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_NAME_ = 11,
50 PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_UNIT_NAME_ = 12,
51 PP_FLASH_X509CERTIFICATE_PRINCIPAL_UNIQUE_ID_ = 13,
52 PP_FLASH_X509CERTIFICATE_VERSION = 14,
53 PP_FLASH_X509CERTIFICATE_SERIAL_NUMBER = 15,
54 PP_FLASH_X509CERTIFICATE_ALGORITHM_OID = 16,
55 PP_FLASH_X509CERTIFICATE_ALGORITHM_PARAMATERS = 17,
56 PP_FLASH_X509CERTIFICATE_VALIDITY_DATE_RANGE = 18,
57 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 19,
58 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY = 20,
59 PP_FLASH_X509CERTIFICATE_DER = 21,
60 PP_FLASH_X509CERTIFICATE_FIELD_COUNT = 22
61 } PP_Flash_X509Certificate_Field;
62 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_X509Certificate_Field, 4);
63 /**
64 * @}
65 */
66
67 /**
68 * @addtogroup Interfaces
69 * @{
70 */
71 /**
72 * The <code>PPB_Flash_X509Certificate</code> interface provides access to
73 * the fields of an X509 certificate.
74 */
75 struct PPB_Flash_X509Certificate_0_1 {
76 /**
77 * Allocates a <code>PPB_Flash_X509Certificate</code> resource.
78 * <code>Init()</code> must be called before using the certificate.
79 */
80 PP_Resource (*Create)(PP_Instance instance);
81 /**
82 * Returns <code>PP_TRUE</code> if a given resource is a
83 * <code>PPB_Flash_X509Certificate</code>.
84 */
85 PP_Bool (*IsFlashX509Certificate)(PP_Resource resource);
86 /**
87 * Initialize a <code>PPB_Flash_X509Certificate</code> from the DER-encoded
88 * representation. |bytes| should represent only a single certificate.
89 * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of
90 * a certificate. Note: Flash requires this to be synchronous.
91 */
92 PP_Bool (*Init)(PP_Resource resource, const char* bytes, uint32_t length);
93 /**
94 * Get a field of the X509Certificate as a |PP_Var|. A null |PP_Var|
95 * is returned if the field is unavailable.
96 */
97 struct PP_Var (*GetField)(PP_Resource resource,
98 PP_Flash_X509Certificate_Field field);
99 };
100
101 typedef struct PPB_Flash_X509Certificate_0_1 PPB_Flash_X509Certificate;
102 /**
103 * @}
104 */
105
106 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_ */
107
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698