Pepper_47_C_interfaces
ppb_x509_certificate_private.h
Go to the documentation of this file.
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_x509_certificate_private.idl,
7  * modified Thu Oct 20 13:57:04 2016.
8  */
9 
10 #ifndef PPAPI_C_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_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_X509CERTIFICATE_PRIVATE_INTERFACE_0_1 \
21  "PPB_X509Certificate_Private;0.1"
22 #define PPB_X509CERTIFICATE_PRIVATE_INTERFACE \
23  PPB_X509CERTIFICATE_PRIVATE_INTERFACE_0_1
24 
25 /**
26  * @file
27  * This file defines the <code>PPB_X509Certificate_Private</code> interface for
28  * an X509 certificate.
29  */
30 
31 
32 /**
33  * @addtogroup Enums
34  * @{
35  */
36 /**
37  * This enumeration corresponds to fields of an X509 certificate. Refer to
38  * <a href="http://www.ietf.org/rfc/rfc5280.txt>RFC 5280</a> for further
39  * documentation about particular fields.
40  */
41 typedef enum {
42  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
44  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
46  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
48  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
50  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
52  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
54  /**
55  * Note: This field is unimplemented and will return
56  * <code>PP_VARTYPE_NULL</code>.
57  */
59  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
61  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
63  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
65  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
67  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
69  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
71  /**
72  * Note: This field is unimplemented and will return
73  * <code>PP_VARTYPE_NULL</code>.
74  */
76  /**
77  * Note: This field is unimplemented and will return
78  * <code>PP_VARTYPE_NULL</code>.
79  */
81  /**
82  * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
83  * The serial number may include a leading 0.
84  */
86  /**
87  * Note: This field is unimplemented and will return
88  * <code>PP_VARTYPE_NULL</code>.
89  */
91  /**
92  * Note: This field is unimplemented and will return
93  * <code>PP_VARTYPE_NULL</code>.
94  */
96  /**
97  * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which
98  * can be cast to a <code>PP_TIME</code>.
99  */
101  /**
102  * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which
103  * can be cast to a <code>PP_TIME</code>.
104  */
106  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
108  /**
109  * Note: This field is unimplemented and will return
110  * <code>PP_VARTYPE_NULL</code>.
111  */
113  /**
114  * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
115  * This is the DER-encoded representation of the certificate.
116  */
118  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
120  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
124 
125 /**
126  * This enumeration defines the different possible values for X5O9 certificate
127  * versions as returned by:
128  * <code>GetField(resource, PP_X509CERTIFICATE_PRIVATE_VERSION)</code>.
129  */
130 typedef enum {
136 /**
137  * @}
138  */
139 
140 /**
141  * @addtogroup Interfaces
142  * @{
143  */
144 /**
145  * The <code>PPB_X509Certificate_Private</code> interface provides access to
146  * the fields of an X509 certificate.
147  */
149  /**
150  * Allocates a <code>PPB_X509Certificate_Private</code> resource.
151  * <code>Initialize()</code> must be called before using the certificate.
152  */
154  /**
155  * Returns <code>PP_TRUE</code> if a given resource is a
156  * <code>PPB_X509Certificate_Private</code>.
157  */
159  /**
160  * Initializes a <code>PPB_X509Certificate_Private</code> from the DER-encoded
161  * representation. |bytes| should represent only a single certificate.
162  * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of
163  * a certificate. Note: Flash requires this to be synchronous.
164  */
166  const char* bytes,
167  uint32_t length);
168  /**
169  * Get a field of the X509Certificate as a <code>PP_Var</code>. A null
170  * <code>PP_Var</code> is returned if the field is unavailable.
171  */
172  struct PP_Var (*GetField)(PP_Resource resource,
174 };
175 
177 /**
178  * @}
179  */
180 
181 #endif /* PPAPI_C_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_H_ */
182 
PP_Bool(* Initialize)(PP_Resource resource, const char *bytes, uint32_t length)
PP_Resource(* Create)(PP_Instance instance)
int32_t PP_Resource
Definition: pp_resource.h:40
PPB_X509Certificate_Private_Version
struct PP_Var(* GetField)(PP_Resource resource, PP_X509Certificate_Private_Field field)
PP_Bool(* IsX509CertificatePrivate)(PP_Resource resource)
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_X509Certificate_Private_Field, 4)
Definition: pp_var.h:166
int32_t PP_Instance
Definition: pp_instance.h:34
PP_Bool
Definition: pp_bool.h:30
PP_X509Certificate_Private_Field