Chromium Code Reviews| 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_Flash_X509_Certificate</code> interface for | |
| 8 * an X509 certificate. | |
| 9 */ | |
| 10 | |
| 11 label Chrome { | |
| 12 M19 = 0.1 | |
| 13 }; | |
| 14 | |
| 15 /** | |
| 16 * Struct for storing information about a certificate issuer or subject. | |
| 17 * All members are <code>PP_Var</code> strings. | |
| 18 */ | |
| 19 struct PP_Flash_X509_Certificate_Principal { | |
| 20 PP_Var common_name; | |
| 21 PP_Var locality_name; | |
| 22 PP_Var state_or_province_name; | |
| 23 PP_Var country_name; | |
| 24 PP_Var organization_name; | |
| 25 PP_Var organization_unit_name; | |
| 26 }; | |
| 27 | |
| 28 [assert_size(4)] | |
| 29 enum PPB_Flash_X509_Certificate_Version { | |
| 30 PP_FLASH_X509_CERTIFICATE_V1 = 0, | |
| 31 PP_FLASH_X509_CERTIFICATE_V2 = 1, | |
| 32 PP_FLASH_X509_CERTIFICATE_V3 = 2 | |
| 33 }; | |
| 34 | |
| 35 /** | |
| 36 * The <code>PPB_Flash_X509_Certificate</code> interface provides access to | |
| 37 * the fields of an X509 certificate. | |
| 38 */ | |
| 39 interface PPB_Flash_X509_Certificate { | |
| 40 /** | |
| 41 * Create a <code>PPB_Flash_X509_Certificate</code> from the DER-encoded | |
| 42 * representation. Returns a null resource if the byte array is not a valid | |
| 43 * X509 certificate. The input data should represent only a single | |
| 44 * certificate. | |
| 45 */ | |
| 46 PP_Resource Create([in] PP_Instance instance, | |
| 47 [in] str_t bytes, | |
| 48 [in] uint32_t length); | |
| 49 | |
| 50 /** | |
| 51 * Returns <code>PP_TRUE</code> if a given resource is a | |
| 52 * <code>PPB_Flash_X509_Certificate</code>. | |
| 53 */ | |
| 54 PP_Bool IsFlashX509Certificate([in] PP_Resource resource); | |
| 55 | |
| 56 /** | |
| 57 * Get the certificate version. | |
| 58 */ | |
| 59 PPB_Flash_X509_Certificate_Version GetVersion([in] PP_Resource certificate); | |
| 60 | |
| 61 /** | |
| 62 * Get the certificate serial number as a byte array with the leading 0 | |
| 63 * included. The data is returned in a <code>PP_Var</code> array buffer. | |
| 64 */ | |
| 65 PP_Var GetSerialNumber([in] PP_Resource certificate); | |
| 66 | |
| 67 /** | |
| 68 * Get the certificate algorithm OID string as a <code>PP_Var</code> string. | |
| 69 */ | |
| 70 PP_Var GetAlgorithmOID([in] PP_Resource certificate); | |
| 71 | |
| 72 /** | |
| 73 * Get the certificate algorithm paramaters as a byte array encoded in DER | |
| 74 * format. The data is returned in a <code>PP_Var</code> array buffer. | |
| 75 */ | |
| 76 PP_Var GetAlgorithmParameters([in] PP_Resource certificate); | |
| 77 | |
| 78 /** | |
| 79 * Get the valid start date of the certificate. | |
|
Ryan Sleevi
2012/02/21 19:22:42
s/valid/validity/ ?
| |
| 80 */ | |
| 81 PP_Time GetVaildStart([in] PP_Resource certificate); | |
| 82 | |
| 83 /** | |
| 84 * Get the valid end date of the certificate. | |
| 85 */ | |
| 86 PP_Time GetVaildEnd([in] PP_Resource certificate); | |
| 87 | |
| 88 /** | |
| 89 * Get the subject public key algorithm OID string as a <code>PP_Var</code> | |
| 90 * string. | |
| 91 */ | |
| 92 PP_Var GetSubjectPublicKeyAlgorithmOID([in] PP_Resource certificate); | |
| 93 | |
| 94 /** | |
| 95 * Get the certificate as a byte array encoded in DER format. The data is | |
| 96 * returned in a <code>PP_Var</code> array buffer. | |
| 97 */ | |
| 98 PP_Var GetDER([in] PP_Resource certificate); | |
| 99 | |
| 100 /** | |
| 101 * Get the subject public key as a byte array. The data is returned in a | |
| 102 * <code>PP_Var</code> array buffer. | |
| 103 */ | |
| 104 PP_Var GetSubjectPublicKey([in] PP_Resource certificate); | |
| 105 | |
| 106 /** | |
| 107 * Get the issuers unique ID as a byte array. The data is returned in a | |
| 108 * <code>PP_Var</code> array buffer. | |
| 109 */ | |
| 110 PP_Var GetIssuerUniqueID([in] PP_Resource certificate); | |
| 111 | |
| 112 /** | |
| 113 * Get the subjects unique ID as a byte array. The data is returned in a | |
| 114 * <code>PP_Var</code> array buffer. | |
|
Ryan Sleevi
2012/02/21 19:22:42
PP_Var can contain NULLs, correct?
I'm just antic
| |
| 115 */ | |
| 116 PP_Var GetSubjectUniqueID([in] PP_Resource certificate); | |
| 117 | |
| 118 /** | |
| 119 * Get information about the certificate issuer. | |
| 120 */ | |
| 121 PP_Flash_X509_Certificate_Principal GetIssuerInfo(PP_Resource certificate); | |
| 122 | |
| 123 /** | |
| 124 * Get information about the certificate subject. | |
| 125 */ | |
| 126 PP_Flash_X509_Certificate_Principal GetSubjectInfo(PP_Resource certificate); | |
| 127 }; | |
| OLD | NEW |