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

Side by Side Diff: ppapi/api/private/ppb_flash_x509_certificate.idl

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 /**
7 * This file defines the <code>PPB_Flash_X509Certificate</code> interface for
8 * an X509 certificate.
9 */
10
11 label Chrome {
12 M19 = 0.1
13 };
14
15 /**
16 * This enumeration corresponds to fields of an X509 certificate. Refer to
17 * <a href="http://www.ietf.org/rfc/rfc5280.txt>RFC 5280</a> for further
18 * documentation about particular fields.
19 */
20 [assert_size(4)]
21 enum PP_Flash_X509Certificate_Field {
22 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
23 PP_FLASH_X509CERTIFICATE_ISSUER_COMMON_NAME = 0,
24
25 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
26 PP_FLASH_X509CERTIFICATE_ISSUER_LOCALITY_NAME = 1,
27
28 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
29 PP_FLASH_X509CERTIFICATE_ISSUER_STATE_OR_PROVINCE_NAME = 2,
30
31 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
32 PP_FLASH_X509CERTIFICATE_ISSUER_COUNTRY_NAME = 3,
33
34 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
35 PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_NAME = 4,
36
37 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
38 PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_UNIT_NAME_ = 5,
yzshen1 2012/03/20 06:48:01 Please remove the trailing underscore. (There are
raymes 2012/03/21 20:28:08 Done.
39
40 /**
41 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
42 */
43 PP_FLASH_X509CERTIFICATE_ISSUER_UNIQUE_ID_ = 6,
44
45 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
46 PP_FLASH_X509CERTIFICATE_PRINCIPAL_COMMON_NAME = 7,
47
48 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
49 PP_FLASH_X509CERTIFICATE_PRINCIPAL_LOCALITY_NAME = 8,
50
51 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
52 PP_FLASH_X509CERTIFICATE_PRINCIPAL_STATE_OR_PROVINCE_NAME = 9,
53
54 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
55 PP_FLASH_X509CERTIFICATE_PRINCIPAL_COUNTRY_NAME = 10,
56
57 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
58 PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_NAME = 11,
59
60 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
61 PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_UNIT_NAME_ = 12,
62
63 /**
64 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
65 */
66 PP_FLASH_X509CERTIFICATE_PRINCIPAL_UNIQUE_ID_ = 13,
67
68 /**
69 * This corresponds to an integer (<code>PP_VARTYPE_INT32</code>) which
70 * which can be cast to a <code>PPB_Flash_X509_Certificate_Version</code>.
71 */
72 PP_FLASH_X509CERTIFICATE_VERSION = 14,
73
74 /**
75 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
76 * The serial number has the leading 0 removed.
77 */
78 PP_FLASH_X509CERTIFICATE_SERIAL_NUMBER = 15,
79
80 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
81 PP_FLASH_X509CERTIFICATE_ALGORITHM_OID = 16,
82
83 /**
84 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>)
85 * which is DER-encoded.
86 */
87 PP_FLASH_X509CERTIFICATE_ALGORITHM_PARAMATERS_RAW = 17,
88
89 /** This corresponds to a date (<code>PP_TIME</code>). */
90 PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_BEFORE = 18,
91
92 /** This corresponds to a date (<code>PP_TIME</code>). */
93 PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_AFTER = 19,
94
95 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
96 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 19,
97
98 /**
99 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
100 */
101 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY = 20,
102
103 /**
104 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
105 * This is the DER-encoded representation of the certificate.
106 */
107 PP_FLASH_X509CERTIFICATE_RAW = 21
108 };
109
110 /**
111 * This enumeration defines the different possible values for X5O9 certificate
112 * versions as returned by:
113 * <code>GetField(resource, PP_FLASH_X509CERTIFICATE_VERSION)</code>.
114 */
115 [assert_size(4)]
116 enum PPB_Flash_X509_Certificate_Version {
yzshen1 2012/03/20 06:48:01 Please remove the underscore between X509 and Cert
raymes 2012/03/21 20:28:08 Done.
117 PP_FLASH_X509_CERTIFICATE_V1 = 0,
118 PP_FLASH_X509_CERTIFICATE_V2 = 1,
119 PP_FLASH_X509_CERTIFICATE_V3 = 2
120 };
121
122 /**
123 * The <code>PPB_Flash_X509Certificate</code> interface provides access to
124 * the fields of an X509 certificate.
125 */
126 interface PPB_Flash_X509Certificate {
127 /**
128 * Allocates a <code>PPB_Flash_X509Certificate</code> resource.
129 * <code>Init()</code> must be called before using the certificate.
130 */
131 PP_Resource Create([in] PP_Instance instance);
132
133 /**
134 * Returns <code>PP_TRUE</code> if a given resource is a
135 * <code>PPB_Flash_X509Certificate</code>.
136 */
137 PP_Bool IsFlashX509Certificate([in] PP_Resource resource);
138
139 /**
140 * Initialize a <code>PPB_Flash_X509Certificate</code> from the DER-encoded
yzshen1 2012/03/20 06:48:01 nit: Initialize -> Initializes.
141 * representation. |bytes| should represent only a single certificate.
142 * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of
143 * a certificate. Note: Flash requires this to be synchronous.
144 */
145 PP_Bool Init([in] PP_Resource resource,
yzshen1 2012/03/20 06:48:01 - Is it necessary to be synchronous? If anything c
raymes 2012/03/21 20:28:08 The flash side is a sync-call from AS. I discussed
146 [in] str_t bytes,
147 [in] uint32_t length);
148
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 PP_Var GetField([in] PP_Resource resource,
154 [in] PP_Flash_X509Certificate_Field field);
155 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698