| 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 /** |
| 7 * This file defines the <code>PPB_X509Certificate_Private</code> interface for |
| 8 * an X509 certificate. |
| 9 */ |
| 10 |
| 11 label Chrome { |
| 12 M19 = 0.1 |
| 13 }; |
| 14 |
| 15 /** |
| 16 * This enumeration corresponds to fields of an X509 certificate. Refer to |
| 17 * <a href="http://www.ietf.org/rfc/rfc5280.txt>RFC 5280</a> for further |
| 18 * documentation about particular fields. |
| 19 */ |
| 20 [assert_size(4)] |
| 21 enum PP_X509Certificate_Private_Field { |
| 22 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 23 PP_X509CERTIFICATE_PRIVATE_ISSUER_COMMON_NAME = 0, |
| 24 |
| 25 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 26 PP_X509CERTIFICATE_PRIVATE_ISSUER_LOCALITY_NAME = 1, |
| 27 |
| 28 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 29 PP_X509CERTIFICATE_PRIVATE_ISSUER_STATE_OR_PROVINCE_NAME = 2, |
| 30 |
| 31 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 32 PP_X509CERTIFICATE_PRIVATE_ISSUER_COUNTRY_NAME = 3, |
| 33 |
| 34 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 35 PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_NAME = 4, |
| 36 |
| 37 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 38 PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_UNIT_NAME = 5, |
| 39 |
| 40 /** |
| 41 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 42 */ |
| 43 PP_X509CERTIFICATE_PRIVATE_ISSUER_UNIQUE_ID = 6, |
| 44 |
| 45 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 46 PP_X509CERTIFICATE_PRIVATE_SUBJECT_COMMON_NAME = 7, |
| 47 |
| 48 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 49 PP_X509CERTIFICATE_PRIVATE_SUBJECT_LOCALITY_NAME = 8, |
| 50 |
| 51 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 52 PP_X509CERTIFICATE_PRIVATE_SUBJECT_STATE_OR_PROVINCE_NAME = 9, |
| 53 |
| 54 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 55 PP_X509CERTIFICATE_PRIVATE_SUBJECT_COUNTRY_NAME = 10, |
| 56 |
| 57 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 58 PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME = 11, |
| 59 |
| 60 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 61 PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME = 12, |
| 62 |
| 63 /** |
| 64 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 65 */ |
| 66 PP_X509CERTIFICATE_PRIVATE_SUBJECT_UNIQUE_ID = 13, |
| 67 |
| 68 /** |
| 69 * This corresponds to an integer (<code>PP_VARTYPE_INT32</code>) which |
| 70 * which can be cast to a <code>PPB_X509Certificate_Private_Version</code>. |
| 71 */ |
| 72 PP_X509CERTIFICATE_PRIVATE_VERSION = 14, |
| 73 |
| 74 /** |
| 75 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 76 * The serial number may include a leading 0. |
| 77 */ |
| 78 PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER = 15, |
| 79 |
| 80 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 81 PP_X509CERTIFICATE_PRIVATE_ALGORITHM_OID = 16, |
| 82 |
| 83 /** |
| 84 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>) |
| 85 * which is DER-encoded. |
| 86 */ |
| 87 PP_X509CERTIFICATE_PRIVATE_ALGORITHM_PARAMATERS_RAW = 17, |
| 88 |
| 89 /** |
| 90 * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which |
| 91 * can be cast to a <code>PP_TIME</code>. |
| 92 */ |
| 93 PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_BEFORE = 18, |
| 94 |
| 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_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_AFTER = 19, |
| 100 |
| 101 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 102 PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 20, |
| 103 |
| 104 /** |
| 105 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 106 */ |
| 107 PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY = 21, |
| 108 |
| 109 /** |
| 110 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| 111 * This is the DER-encoded representation of the certificate. |
| 112 */ |
| 113 PP_X509CERTIFICATE_PRIVATE_RAW = 22 |
| 114 }; |
| 115 |
| 116 /** |
| 117 * This enumeration defines the different possible values for X5O9 certificate |
| 118 * versions as returned by: |
| 119 * <code>GetField(resource, PP_X509CERTIFICATE_PRIVATE_VERSION)</code>. |
| 120 */ |
| 121 [assert_size(4)] |
| 122 enum PPB_X509Certificate_Private_Version { |
| 123 PP_X509CERTIFICATE_PRIVATE_V1 = 0, |
| 124 PP_X509CERTIFICATE_PRIVATE_V2 = 1, |
| 125 PP_X509CERTIFICATE_PRIVATE_V3 = 2 |
| 126 }; |
| 127 |
| 128 /** |
| 129 * The <code>PPB_X509Certificate_Private</code> interface provides access to |
| 130 * the fields of an X509 certificate. |
| 131 */ |
| 132 interface PPB_X509Certificate_Private { |
| 133 /** |
| 134 * Allocates a <code>PPB_X509Certificate_Private</code> resource. |
| 135 * <code>Initialize()</code> must be called before using the certificate. |
| 136 */ |
| 137 PP_Resource Create([in] PP_Instance instance); |
| 138 |
| 139 /** |
| 140 * Returns <code>PP_TRUE</code> if a given resource is a |
| 141 * <code>PPB_X509Certificate_Private</code>. |
| 142 */ |
| 143 PP_Bool IsX509CertificatePrivate([in] PP_Resource resource); |
| 144 |
| 145 /** |
| 146 * Initializes a <code>PPB_X509Certificate_Private</code> from the DER-encoded |
| 147 * representation. |bytes| should represent only a single certificate. |
| 148 * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of |
| 149 * a certificate. Note: Flash requires this to be synchronous. |
| 150 */ |
| 151 PP_Bool Initialize([in] PP_Resource resource, |
| 152 [in] str_t bytes, |
| 153 [in] uint32_t length); |
| 154 |
| 155 /** |
| 156 * Get a field of the X509Certificate as a <code>PP_Var</code>. A null |
| 157 * <code>PP_Var</code> is returned if the field is unavailable. |
| 158 */ |
| 159 PP_Var GetField([in] PP_Resource resource, |
| 160 [in] PP_X509Certificate_Private_Field field); |
| 161 }; |
| OLD | NEW |