| OLD | NEW |
| (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_x509_certificate_private.idl, |
| 7 * modified Fri Mar 23 09:40:44 2012. |
| 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>). */ |
| 43 PP_X509CERTIFICATE_PRIVATE_ISSUER_COMMON_NAME = 0, |
| 44 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 45 PP_X509CERTIFICATE_PRIVATE_ISSUER_LOCALITY_NAME = 1, |
| 46 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 47 PP_X509CERTIFICATE_PRIVATE_ISSUER_STATE_OR_PROVINCE_NAME = 2, |
| 48 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 49 PP_X509CERTIFICATE_PRIVATE_ISSUER_COUNTRY_NAME = 3, |
| 50 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 51 PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_NAME = 4, |
| 52 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 53 PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_UNIT_NAME = 5, |
| 54 /** |
| 55 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 56 */ |
| 57 PP_X509CERTIFICATE_PRIVATE_ISSUER_UNIQUE_ID = 6, |
| 58 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 59 PP_X509CERTIFICATE_PRIVATE_SUBJECT_COMMON_NAME = 7, |
| 60 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 61 PP_X509CERTIFICATE_PRIVATE_SUBJECT_LOCALITY_NAME = 8, |
| 62 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 63 PP_X509CERTIFICATE_PRIVATE_SUBJECT_STATE_OR_PROVINCE_NAME = 9, |
| 64 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 65 PP_X509CERTIFICATE_PRIVATE_SUBJECT_COUNTRY_NAME = 10, |
| 66 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 67 PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME = 11, |
| 68 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 69 PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME = 12, |
| 70 /** |
| 71 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 72 */ |
| 73 PP_X509CERTIFICATE_PRIVATE_SUBJECT_UNIQUE_ID = 13, |
| 74 /** |
| 75 * This corresponds to an integer (<code>PP_VARTYPE_INT32</code>) which |
| 76 * which can be cast to a <code>PPB_X509Certificate_Private_Version</code>. |
| 77 */ |
| 78 PP_X509CERTIFICATE_PRIVATE_VERSION = 14, |
| 79 /** |
| 80 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 81 * The serial number may include a leading 0. |
| 82 */ |
| 83 PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER = 15, |
| 84 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 85 PP_X509CERTIFICATE_PRIVATE_ALGORITHM_OID = 16, |
| 86 /** |
| 87 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>) |
| 88 * which is DER-encoded. |
| 89 */ |
| 90 PP_X509CERTIFICATE_PRIVATE_ALGORITHM_PARAMATERS_RAW = 17, |
| 91 /** |
| 92 * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which |
| 93 * can be cast to a <code>PP_TIME</code>. |
| 94 */ |
| 95 PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_BEFORE = 18, |
| 96 /** |
| 97 * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which |
| 98 * can be cast to a <code>PP_TIME</code>. |
| 99 */ |
| 100 PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_AFTER = 19, |
| 101 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 102 PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 20, |
| 103 /** |
| 104 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 105 */ |
| 106 PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY = 21, |
| 107 /** |
| 108 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 109 * This is the DER-encoded representation of the certificate. |
| 110 */ |
| 111 PP_X509CERTIFICATE_PRIVATE_RAW = 22 |
| 112 } PP_X509Certificate_Private_Field; |
| 113 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_X509Certificate_Private_Field, 4); |
| 114 |
| 115 /** |
| 116 * This enumeration defines the different possible values for X5O9 certificate |
| 117 * versions as returned by: |
| 118 * <code>GetField(resource, PP_X509CERTIFICATE_PRIVATE_VERSION)</code>. |
| 119 */ |
| 120 typedef enum { |
| 121 PP_X509CERTIFICATE_PRIVATE_V1 = 0, |
| 122 PP_X509CERTIFICATE_PRIVATE_V2 = 1, |
| 123 PP_X509CERTIFICATE_PRIVATE_V3 = 2 |
| 124 } PPB_X509Certificate_Private_Version; |
| 125 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPB_X509Certificate_Private_Version, 4); |
| 126 /** |
| 127 * @} |
| 128 */ |
| 129 |
| 130 /** |
| 131 * @addtogroup Interfaces |
| 132 * @{ |
| 133 */ |
| 134 /** |
| 135 * The <code>PPB_X509Certificate_Private</code> interface provides access to |
| 136 * the fields of an X509 certificate. |
| 137 */ |
| 138 struct PPB_X509Certificate_Private_0_1 { |
| 139 /** |
| 140 * Allocates a <code>PPB_X509Certificate_Private</code> resource. |
| 141 * <code>Initialize()</code> must be called before using the certificate. |
| 142 */ |
| 143 PP_Resource (*Create)(PP_Instance instance); |
| 144 /** |
| 145 * Returns <code>PP_TRUE</code> if a given resource is a |
| 146 * <code>PPB_X509Certificate_Private</code>. |
| 147 */ |
| 148 PP_Bool (*IsX509CertificatePrivate)(PP_Resource resource); |
| 149 /** |
| 150 * Initializes a <code>PPB_X509Certificate_Private</code> from the DER-encoded |
| 151 * representation. |bytes| should represent only a single certificate. |
| 152 * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of |
| 153 * a certificate. Note: Flash requires this to be synchronous. |
| 154 */ |
| 155 PP_Bool (*Initialize)(PP_Resource resource, |
| 156 const char* bytes, |
| 157 uint32_t length); |
| 158 /** |
| 159 * Get a field of the X509Certificate as a <code>PP_Var</code>. A null |
| 160 * <code>PP_Var</code> is returned if the field is unavailable. |
| 161 */ |
| 162 struct PP_Var (*GetField)(PP_Resource resource, |
| 163 PP_X509Certificate_Private_Field field); |
| 164 }; |
| 165 |
| 166 typedef struct PPB_X509Certificate_Private_0_1 PPB_X509Certificate_Private; |
| 167 /** |
| 168 * @} |
| 169 */ |
| 170 |
| 171 #endif /* PPAPI_C_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_H_ */ |
| 172 |
| OLD | NEW |