| 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 Feb 16 10:17:57 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 Structs |
| 33 * @{ |
| 34 */ |
| 35 /** |
| 36 * Struct for storing information about a certificate issuer or subject. |
| 37 * All members are <code>PP_Var</code> strings. |
| 38 */ |
| 39 struct PP_Flash_X509Certificate_Principal { |
| 40 struct PP_Var common_name; |
| 41 struct PP_Var locality_name; |
| 42 struct PP_Var state_or_province_name; |
| 43 struct PP_Var country_name; |
| 44 struct PP_Var organization_name; |
| 45 struct PP_Var organization_unit_name; |
| 46 }; |
| 47 /** |
| 48 * @} |
| 49 */ |
| 50 |
| 51 /** |
| 52 * @addtogroup Enums |
| 53 * @{ |
| 54 */ |
| 55 typedef enum { |
| 56 PP_FLASH_X509_CERTIFICATE_V1 = 0, |
| 57 PP_FLASH_X509CERTIFICATE_V2 = 1, |
| 58 PP_FLASH_X509CERTIFICATE_V3 = 2 |
| 59 } PPB_Flash_X509Certificate_Version; |
| 60 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPB_Flash_X509Certificate_Version, 4); |
| 61 /** |
| 62 * @} |
| 63 */ |
| 64 |
| 65 /** |
| 66 * @addtogroup Interfaces |
| 67 * @{ |
| 68 */ |
| 69 /** |
| 70 * The <code>PPB_Flash_X509Certificate</code> interface provides access to |
| 71 * the fields of an X509 certificate. |
| 72 */ |
| 73 struct PPB_Flash_X509Certificate_0_1 { |
| 74 /** |
| 75 * Create a <code>PPB_Flash_X509Certificate</code> from the DER-encoded |
| 76 * representation. Returns a null resource if the byte array is not a valid |
| 77 * X509 certificate. |
| 78 */ |
| 79 PP_Resource (*Create)(PP_Instance instance, |
| 80 const void* bytes, |
| 81 int32_t length); |
| 82 /** |
| 83 * Returns <code>PP_TRUE</code> if a given resource is a |
| 84 * <code>PPB_Flash_X509Certificate</code>. |
| 85 */ |
| 86 PP_Bool (*IsFlashX509Certificate)(PP_Resource resource); |
| 87 /** |
| 88 * Get the certificate version. |
| 89 */ |
| 90 PPB_Flash_X509Certificate_Version (*GetVersion)(PP_Resource certificate); |
| 91 /** |
| 92 * Get the certificate serial number as a byte array. |
| 93 */ |
| 94 void* (*GetSerialNumber)(PP_Resource certificate, uint32_t* length); |
| 95 /** |
| 96 * Get the certificate algorithm ID as a <code>PP_Var</code> string. |
| 97 */ |
| 98 struct PP_Var (*GetAlgorithmID)(PP_Resource certificate); |
| 99 /** |
| 100 * Get the certificate algorithm paramaters as a byte array. |
| 101 */ |
| 102 void* (*GetAlgorithmParamaters)(PP_Resource certificate, uint32_t* length); |
| 103 /** |
| 104 * Get the valid start date as a timestamp. |
| 105 */ |
| 106 uint32_t (*GetVaildStart)(PP_Resource certificate); |
| 107 /** |
| 108 * Get the valid end date as a timestamp. |
| 109 */ |
| 110 uint32_t (*GetVaildEnd)(PP_Resource certificate); |
| 111 /** |
| 112 * Get the subject public key algorithm ID as a <code>PP_Var</code> string. |
| 113 */ |
| 114 struct PP_Var (*GetSubjectPublicKeyAlgorithmID)(PP_Resource certificate); |
| 115 /** |
| 116 * Get the subject public key as a byte array. |
| 117 */ |
| 118 struct PP_Var (*GetSubjectPublicKey)(PP_Resource certificate, |
| 119 uint32_t* length); |
| 120 /** |
| 121 * Get the certificate as a byte array encoded in DER format. |
| 122 */ |
| 123 void* (*GetDER)(PP_Resource certificate, uint32_t* length); |
| 124 /** |
| 125 * Get the subject public key as a byte array. |
| 126 */ |
| 127 struct PP_Var (*GetSubjectPublicKey)(PP_Resource certificate, |
| 128 uint32_t* length); |
| 129 /** |
| 130 * Get the issuers unique ID as a byte array. |
| 131 */ |
| 132 void* (*GetIssuerUniqueID)(PP_Resource certificate, uint32_t* length); |
| 133 /** |
| 134 * Get the subjects unique ID as a byte array. |
| 135 */ |
| 136 void* (*GetSubjectUniqueID)(PP_Resource certificate, uint32_t* length); |
| 137 /** |
| 138 * Get information about the certificate issuer. |
| 139 */ |
| 140 struct PP_Flash_X509Certificate_Principal* (*GetIssuerInfo)( |
| 141 PP_Resource certificate); |
| 142 /** |
| 143 * Get information about the certificate subject. |
| 144 */ |
| 145 struct PP_Flash_X509Certificate_Principal* (*GetSubjectInfo)( |
| 146 PP_Resource certificate); |
| 147 }; |
| 148 |
| 149 typedef struct PPB_Flash_X509Certificate_0_1 PPB_Flash_X509Certificate; |
| 150 /** |
| 151 * @} |
| 152 */ |
| 153 |
| 154 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_ */ |
| 155 |
| OLD | NEW |