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_X509Certificate</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_X509Certificate_Principal { | |
|
Ryan Sleevi
2012/02/16 21:29:23
An actual principal name is:
an ordered array of
raymes
2012/02/16 22:31:29
These are the only fields required by flash.
On 2
Ryan Sleevi
2012/02/16 23:06:33
For a Flash-specific API: This is OK. It's Adobe's
| |
| 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_X509Certificate_Version { | |
|
Ryan Sleevi
2012/02/16 21:29:23
Is there a reason you need to expose version?
raymes
2012/02/16 22:31:29
AFAICT it's exposed in actionscript (although not
Ryan Sleevi
2012/02/16 23:06:33
Adobe's API sucks.
That said, use either X509_CER
raymes
2012/02/21 19:07:40
Done.
| |
| 30 PP_FLASH_X509_CERTIFICATE_V1 = 0, | |
| 31 PP_FLASH_X509CERTIFICATE_V2 = 1, | |
| 32 PP_FLASH_X509CERTIFICATE_V3 = 2 | |
| 33 }; | |
| 34 | |
| 35 /** | |
| 36 * The <code>PPB_Flash_X509Certificate</code> interface provides access to | |
| 37 * the fields of an X509 certificate. | |
| 38 */ | |
| 39 interface PPB_Flash_X509Certificate { | |
| 40 /** | |
| 41 * Create a <code>PPB_Flash_X509Certificate</code> from the DER-encoded | |
| 42 * representation. Returns a null resource if the byte array is not a valid | |
| 43 * X509 certificate. | |
| 44 */ | |
| 45 PP_Resource Create([in] PP_Instance instance, | |
| 46 [in] mem_t bytes, | |
| 47 [in] int32_t length); | |
|
Ryan Sleevi
2012/02/16 21:29:23
Create takes (in) int32_t, but other APIs (GetSeri
raymes
2012/02/16 22:31:29
Done. Thanks for the catch.
| |
| 48 | |
| 49 /** | |
| 50 * Returns <code>PP_TRUE</code> if a given resource is a | |
| 51 * <code>PPB_Flash_X509Certificate</code>. | |
| 52 */ | |
| 53 PP_Bool IsFlashX509Certificate([in] PP_Resource resource); | |
| 54 | |
| 55 /** | |
| 56 * Get the certificate version. | |
| 57 */ | |
| 58 PPB_Flash_X509Certificate_Version GetVersion([in] PP_Resource certificate); | |
| 59 | |
| 60 /** | |
| 61 * Get the certificate serial number as a byte array. | |
| 62 */ | |
| 63 mem_t GetSerialNumber([in] PP_Resource certificate, | |
|
Ryan Sleevi
2012/02/16 21:29:23
There's some unfortunate subtlety here re: X.509
raymes
2012/02/16 22:31:29
A byte string I guess, with the leading 0 removed
Ryan Sleevi
2012/02/16 23:06:33
(Adobe rant).
This unfortunately can create ambig
raymes
2012/02/21 19:07:40
Done.
| |
| 64 [out] uint32_t length); | |
| 65 | |
| 66 /** | |
| 67 * Get the certificate algorithm ID as a <code>PP_Var</code> string. | |
| 68 */ | |
| 69 PP_Var GetAlgorithmID([in] PP_Resource certificate); | |
|
Ryan Sleevi
2012/02/16 21:29:23
This is the signature algorithm, not the SPKI algo
raymes
2012/02/16 22:31:29
Yes, the signature OID string. I will update the n
raymes
2012/02/21 19:07:40
Done.
| |
| 70 | |
| 71 /** | |
| 72 * Get the certificate algorithm paramaters as a byte array. | |
| 73 */ | |
| 74 mem_t GetAlgorithmParamaters([in] PP_Resource certificate, | |
|
Ryan Sleevi
2012/02/16 21:29:23
As... DER?
And why not expose the algorithm itsel
raymes
2012/02/16 22:31:29
This is just what flash required. The format is th
Ryan Sleevi
2012/02/16 23:06:33
Thanks. Yeah, this is DER.
raymes
2012/02/21 19:07:40
Done.
| |
| 75 [out] uint32_t length); | |
| 76 | |
| 77 /** | |
| 78 * Get the valid start date as a timestamp. | |
| 79 */ | |
| 80 uint32_t GetVaildStart([in] PP_Resource certificate); | |
| 81 | |
| 82 /** | |
| 83 * Get the valid end date as a timestamp. | |
| 84 */ | |
| 85 uint32_t GetVaildEnd([in] PP_Resource certificate); | |
| 86 | |
|
Ryan Sleevi
2012/02/16 21:29:23
Typo: Vaild -> Valid
This will definitely cause i
raymes
2012/02/16 22:31:29
Right, I should have used a larger int. Would chan
Ryan Sleevi
2012/02/16 23:06:33
"It would be nice" to expose a PPAPI date type her
raymes
2012/02/21 19:07:40
Done.
| |
| 87 /** | |
| 88 * Get the subject public key algorithm ID as a <code>PP_Var</code> string. | |
| 89 */ | |
| 90 PP_Var GetSubjectPublicKeyAlgorithmID([in] PP_Resource certificate); | |
|
Ryan Sleevi
2012/02/16 21:29:23
It's unclear what this stores.
Is it a string suc
raymes
2012/02/16 22:31:29
It's again the OID of the algorithm, I can update
raymes
2012/02/21 19:07:40
Done.
| |
| 91 | |
| 92 /** | |
| 93 * Get the subject public key as a byte array. | |
| 94 */ | |
| 95 PP_Var GetSubjectPublicKey([in] PP_Resource certificate, | |
| 96 [out] uint32_t length); | |
| 97 | |
| 98 /** | |
| 99 * Get the certificate as a byte array encoded in DER format. | |
| 100 */ | |
| 101 mem_t GetDER([in] PP_Resource certificate, | |
| 102 [out] uint32_t length); | |
| 103 | |
| 104 /** | |
| 105 * Get the subject public key as a byte array. | |
| 106 */ | |
| 107 PP_Var GetSubjectPublicKey([in] PP_Resource certificate, | |
|
Ryan Sleevi
2012/02/16 21:29:23
Duplicate declaration to line 95-96
raymes
2012/02/16 22:31:29
Done.
| |
| 108 [out] uint32_t length); | |
| 109 | |
| 110 /** | |
| 111 * Get the issuers unique ID as a byte array. | |
| 112 */ | |
| 113 mem_t GetIssuerUniqueID([in] PP_Resource certificate, | |
| 114 [out] uint32_t length); | |
| 115 | |
| 116 /** | |
| 117 * Get the subjects unique ID as a byte array. | |
|
Ryan Sleevi
2012/02/16 21:29:23
What is "unique ID" ?
Do you mean authorityKeyId
raymes
2012/02/16 22:31:29
It's SubjectUniqueId->http://msdn.microsoft.com/en
Ryan Sleevi
2012/02/16 23:06:33
Flash sucks.
I don't think I've ever seen a issue
| |
| 118 */ | |
| 119 mem_t GetSubjectUniqueID([in] PP_Resource certificate, | |
| 120 [out] uint32_t length); | |
| 121 | |
| 122 /** | |
| 123 * Get information about the certificate issuer. | |
| 124 */ | |
| 125 PP_Flash_X509Certificate_Principal GetIssuerInfo(PP_Resource certificate); | |
| 126 | |
| 127 /** | |
| 128 * Get information about the certificate subject. | |
| 129 */ | |
| 130 PP_Flash_X509Certificate_Principal GetSubjectInfo(PP_Resource certificate); | |
| 131 }; | |
| OLD | NEW |