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

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 Thu Mar 15 13:26:44 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 typedef enum {
36 /* Issuer/principal common name, locality name, state or province name,
37 * country name, organization name and organization unit name are returned as
38 * <code>PP_VARTYPE_STRING</code>. */
39 PP_FLASH_X509CERTIFICATE_ISSUER_COMMON_NAME_ = 0,
40 PP_FLASH_X509CERTIFICATE_ISSUER_LOCALITY_NAME_ = 1,
41 PP_FLASH_X509CERTIFICATE_ISSUER_STATE_OR_PROVINCE_NAME_ = 2,
42 PP_FLASH_X509CERTIFICATE_ISSUER_COUNTRY_NAME_ = 3,
43 PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_NAME_ = 4,
44 PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_UNIT_NAME_ = 5,
45 /* The issuer/principal unique ID is returned as a
46 * <code>PP_VARTYPE_ARRAY_BUFFER</code>. */
47 PP_FLASH_X509CERTIFICATE_ISSUER_UNIQUE_ID_ = 6,
48 PP_FLASH_X509CERTIFICATE_PRINCIPAL_COMMON_NAME_ = 7,
49 PP_FLASH_X509CERTIFICATE_PRINCIPAL_LOCALITY_NAME_ = 8,
50 PP_FLASH_X509CERTIFICATE_PRINCIPAL_STATE_OR_PROVINCE_NAME_ = 9,
51 PP_FLASH_X509CERTIFICATE_PRINCIPAL_COUNTRY_NAME_ = 10,
52 PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_NAME_ = 11,
53 PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_UNIT_NAME_ = 12,
54 PP_FLASH_X509CERTIFICATE_PRINCIPAL_UNIQUE_ID_ = 13,
55 /* The certificate version is returned as a <code>PP_VARTYPE_INT32</code> with
56 * 0=X509v1, 1=X509v2, 2=X509v3. */
57 PP_FLASH_X509CERTIFICATE_VERSION = 14,
58 /* The certificate serial number is returned as a
59 * <code>PP_VARTYPE_ARRAY_BUFFER</code> with the leading 0 removed. */
60 PP_FLASH_X509CERTIFICATE_SERIAL_NUMBER = 15,
61 /* The algorithm OID is returned as a <code>PP_VARTYPE_STRING</code>. */
62 PP_FLASH_X509CERTIFICATE_ALGORITHM_OID = 16,
63 /* The algorithm paramaters encoded in DER are returned as a
64 * <code>PP_VARTYPE_STRING</code>. */
65 PP_FLASH_X509CERTIFICATE_ALGORITHM_PARAMATERS_RAW = 17,
66 /* The validity not before and not after dates are returned as
67 * <code>PP_TIME</code>. */
68 PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_BEFORE = 18,
69 PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_AFTER = 19,
70 /* The subject public key algorithm OID is returned as a
71 * <code>PP_VARTYPE_STRING</code>. */
72 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 19,
73 /* The public key is returned as a <code>PP_VARTYPE_ARRAY_BUFFER</code>. */
74 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY = 20,
75 /* The raw certificate encoded in DER format is returned as a
76 * <code>PP_VARTYPE_ARRAY_BUFFER</code>. */
77 PP_FLASH_X509CERTIFICATE_RAW = 21
78 } PP_Flash_X509Certificate_Field;
79 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_X509Certificate_Field, 4);
80 /**
81 * @}
82 */
83
84 /**
85 * @addtogroup Interfaces
86 * @{
87 */
88 /**
89 * The <code>PPB_Flash_X509Certificate</code> interface provides access to
90 * the fields of an X509 certificate.
91 */
92 struct PPB_Flash_X509Certificate_0_1 {
93 /**
94 * Allocates a <code>PPB_Flash_X509Certificate</code> resource.
95 * <code>Init()</code> must be called before using the certificate.
96 */
97 PP_Resource (*Create)(PP_Instance instance);
98 /**
99 * Returns <code>PP_TRUE</code> if a given resource is a
100 * <code>PPB_Flash_X509Certificate</code>.
101 */
102 PP_Bool (*IsFlashX509Certificate)(PP_Resource resource);
103 /**
104 * Initialize a <code>PPB_Flash_X509Certificate</code> from the DER-encoded
105 * representation. |bytes| should represent only a single certificate.
106 * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of
107 * a certificate. Note: Flash requires this to be synchronous.
108 */
109 PP_Bool (*Init)(PP_Resource resource, const char* bytes, uint32_t length);
110 /**
111 * Get a field of the X509Certificate as a <code>PP_Var</code>. A null
112 * <code>PP_Var</code> is returned if the field is unavailable.
113 */
114 struct PP_Var (*GetField)(PP_Resource resource,
115 PP_Flash_X509Certificate_Field field);
116 };
117
118 typedef struct PPB_Flash_X509Certificate_0_1 PPB_Flash_X509Certificate;
119 /**
120 * @}
121 */
122
123 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_ */
124
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698