| 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_flash_x509_certificate.idl, |
| 7 * modified Thu Mar 22 14:52:41 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_SUBJECT_COMMON_NAME = 7, |
| 59 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 60 PP_FLASH_X509CERTIFICATE_SUBJECT_LOCALITY_NAME = 8, |
| 61 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 62 PP_FLASH_X509CERTIFICATE_SUBJECT_STATE_OR_PROVINCE_NAME = 9, |
| 63 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 64 PP_FLASH_X509CERTIFICATE_SUBJECT_COUNTRY_NAME = 10, |
| 65 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 66 PP_FLASH_X509CERTIFICATE_SUBJECT_ORGANIZATION_NAME = 11, |
| 67 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 68 PP_FLASH_X509CERTIFICATE_SUBJECT_ORGANIZATION_UNIT_NAME = 12, |
| 69 /** |
| 70 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 71 */ |
| 72 PP_FLASH_X509CERTIFICATE_SUBJECT_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 may include a leading 0. |
| 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 /** |
| 91 * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which |
| 92 * can be cast to a <code>PP_TIME</code>. |
| 93 */ |
| 94 PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_BEFORE = 18, |
| 95 /** |
| 96 * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which |
| 97 * can be cast to a <code>PP_TIME</code>. |
| 98 */ |
| 99 PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_AFTER = 19, |
| 100 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 101 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 20, |
| 102 /** |
| 103 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 104 */ |
| 105 PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY = 21, |
| 106 /** |
| 107 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 108 * This is the DER-encoded representation of the certificate. |
| 109 */ |
| 110 PP_FLASH_X509CERTIFICATE_RAW = 22 |
| 111 } PP_Flash_X509Certificate_Field; |
| 112 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_X509Certificate_Field, 4); |
| 113 |
| 114 /** |
| 115 * This enumeration defines the different possible values for X5O9 certificate |
| 116 * versions as returned by: |
| 117 * <code>GetField(resource, PP_FLASH_X509CERTIFICATE_VERSION)</code>. |
| 118 */ |
| 119 typedef enum { |
| 120 PP_FLASH_X509CERTIFICATE_V1 = 0, |
| 121 PP_FLASH_X509CERTIFICATE_V2 = 1, |
| 122 PP_FLASH_X509CERTIFICATE_V3 = 2 |
| 123 } PPB_Flash_X509Certificate_Version; |
| 124 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPB_Flash_X509Certificate_Version, 4); |
| 125 /** |
| 126 * @} |
| 127 */ |
| 128 |
| 129 /** |
| 130 * @addtogroup Interfaces |
| 131 * @{ |
| 132 */ |
| 133 /** |
| 134 * The <code>PPB_Flash_X509Certificate</code> interface provides access to |
| 135 * the fields of an X509 certificate. |
| 136 */ |
| 137 struct PPB_Flash_X509Certificate_0_1 { |
| 138 /** |
| 139 * Allocates a <code>PPB_Flash_X509Certificate</code> resource. |
| 140 * <code>Initialize()</code> must be called before using the certificate. |
| 141 */ |
| 142 PP_Resource (*Create)(PP_Instance instance); |
| 143 /** |
| 144 * Returns <code>PP_TRUE</code> if a given resource is a |
| 145 * <code>PPB_Flash_X509Certificate</code>. |
| 146 */ |
| 147 PP_Bool (*IsFlashX509Certificate)(PP_Resource resource); |
| 148 /** |
| 149 * Initializes a <code>PPB_Flash_X509Certificate</code> from the DER-encoded |
| 150 * representation. |bytes| should represent only a single certificate. |
| 151 * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of |
| 152 * a certificate. Note: Flash requires this to be synchronous. |
| 153 */ |
| 154 PP_Bool (*Initialize)(PP_Resource resource, |
| 155 const char* bytes, |
| 156 uint32_t length); |
| 157 /** |
| 158 * Get a field of the X509Certificate as a <code>PP_Var</code>. A null |
| 159 * <code>PP_Var</code> is returned if the field is unavailable. |
| 160 */ |
| 161 struct PP_Var (*GetField)(PP_Resource resource, |
| 162 PP_Flash_X509Certificate_Field field); |
| 163 }; |
| 164 |
| 165 typedef struct PPB_Flash_X509Certificate_0_1 PPB_Flash_X509Certificate; |
| 166 /** |
| 167 * @} |
| 168 */ |
| 169 |
| 170 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_ */ |
| 171 |
| OLD | NEW |