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

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 Fri Mar 16 09:39:31 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 /**
36 * This enumeration corresponds to fields of an X509 certificate. Refer to
37 * <a href="http://www.ietf.org/rfc/rfc5280.txt>RFC 5280</a> for further
38 * documentation about particular fields.
39 */
40 typedef enum {
41 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
42 PP_FLASH_X509CERTIFICATE_ISSUER_COMMON_NAME = 0,
43 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
44 PP_FLASH_X509CERTIFICATE_ISSUER_LOCALITY_NAME = 1,
45 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
46 PP_FLASH_X509CERTIFICATE_ISSUER_STATE_OR_PROVINCE_NAME = 2,
47 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
48 PP_FLASH_X509CERTIFICATE_ISSUER_COUNTRY_NAME = 3,
49 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
50 PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_NAME = 4,
51 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
52 PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_UNIT_NAME_ = 5,
53 /**
54 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
55 */
56 PP_FLASH_X509CERTIFICATE_ISSUER_UNIQUE_ID_ = 6,
57 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
58 PP_FLASH_X509CERTIFICATE_PRINCIPAL_COMMON_NAME = 7,
59 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
60 PP_FLASH_X509CERTIFICATE_PRINCIPAL_LOCALITY_NAME = 8,
61 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
62 PP_FLASH_X509CERTIFICATE_PRINCIPAL_STATE_OR_PROVINCE_NAME = 9,
63 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
64 PP_FLASH_X509CERTIFICATE_PRINCIPAL_COUNTRY_NAME = 10,
65 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
66 PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_NAME = 11,
67 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
68 PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_UNIT_NAME_ = 12,
69 /**
70 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
71 */
72 PP_FLASH_X509CERTIFICATE_PRINCIPAL_UNIQUE_ID_ = 13,
73 /**
74 * This corresponds to an integer (<code>PP_VARTYPE_INT32</code>) which
75 * which can be cast to a <code>PPB_Flash_X509_Certificate_Version</code>.
76 */
77 PP_FLASH_X509CERTIFICATE_VERSION = 14,
78 /**
79 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
80 * The serial number has the leading 0 removed.
81 */
82 PP_FLASH_X509CERTIFICATE_SERIAL_NUMBER = 15,
83 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
84 PP_FLASH_X509CERTIFICATE_ALGORITHM_OID = 16,
85 /**
86 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>)
87 * which is DER-encoded.
88 */
89 PP_FLASH_X509CERTIFICATE_ALGORITHM_PARAMATERS_RAW = 17,
90 /** This corresponds to a date (<code>PP_TIME</code>). */
91 PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_BEFORE = 18,
92 /** This corresponds to a date (<code>PP_TIME</code>). */
93 PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_AFTER = 19,
94 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
95 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 19,
96 /**
97 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
98 */
99 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY = 20,
100 /**
101 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
102 * This is the DER-encoded representation of the certificate.
103 */
104 PP_FLASH_X509CERTIFICATE_RAW = 21
105 } PP_Flash_X509Certificate_Field;
106 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_X509Certificate_Field, 4);
107
108 /**
109 * This enumeration defines the different possible values for X5O9 certificate
110 * versions as returned by:
111 * <code>GetField(resource, PP_FLASH_X509CERTIFICATE_VERSION)</code>.
112 */
113 typedef enum {
114 PP_FLASH_X509_CERTIFICATE_V1 = 0,
115 PP_FLASH_X509_CERTIFICATE_V2 = 1,
116 PP_FLASH_X509_CERTIFICATE_V3 = 2
117 } PPB_Flash_X509_Certificate_Version;
118 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPB_Flash_X509_Certificate_Version, 4);
119 /**
120 * @}
121 */
122
123 /**
124 * @addtogroup Interfaces
125 * @{
126 */
127 /**
128 * The <code>PPB_Flash_X509Certificate</code> interface provides access to
129 * the fields of an X509 certificate.
130 */
131 struct PPB_Flash_X509Certificate_0_1 {
132 /**
133 * Allocates a <code>PPB_Flash_X509Certificate</code> resource.
134 * <code>Init()</code> must be called before using the certificate.
135 */
136 PP_Resource (*Create)(PP_Instance instance);
137 /**
138 * Returns <code>PP_TRUE</code> if a given resource is a
139 * <code>PPB_Flash_X509Certificate</code>.
140 */
141 PP_Bool (*IsFlashX509Certificate)(PP_Resource resource);
142 /**
143 * Initialize a <code>PPB_Flash_X509Certificate</code> from the DER-encoded
144 * representation. |bytes| should represent only a single certificate.
145 * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of
146 * a certificate. Note: Flash requires this to be synchronous.
147 */
148 PP_Bool (*Init)(PP_Resource resource, const char* bytes, uint32_t length);
149 /**
150 * Get a field of the X509Certificate as a <code>PP_Var</code>. A null
151 * <code>PP_Var</code> is returned if the field is unavailable.
152 */
153 struct PP_Var (*GetField)(PP_Resource resource,
154 PP_Flash_X509Certificate_Field field);
155 };
156
157 typedef struct PPB_Flash_X509Certificate_0_1 PPB_Flash_X509Certificate;
158 /**
159 * @}
160 */
161
162 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_ */
163
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698