Chromium Code Reviews| Index: ppapi/api/private/ppb_flash_x509_certificate.idl |
| diff --git a/ppapi/api/private/ppb_flash_x509_certificate.idl b/ppapi/api/private/ppb_flash_x509_certificate.idl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1b85c262336c7d07c81b3483940f8669889c4359 |
| --- /dev/null |
| +++ b/ppapi/api/private/ppb_flash_x509_certificate.idl |
| @@ -0,0 +1,155 @@ |
| +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +/** |
| + * This file defines the <code>PPB_Flash_X509Certificate</code> interface for |
| + * an X509 certificate. |
| + */ |
| + |
| +label Chrome { |
| + M19 = 0.1 |
| +}; |
| + |
| +/** |
| + * This enumeration corresponds to fields of an X509 certificate. Refer to |
| + * <a href="http://www.ietf.org/rfc/rfc5280.txt>RFC 5280</a> for further |
| + * documentation about particular fields. |
| + */ |
| +[assert_size(4)] |
| +enum PP_Flash_X509Certificate_Field { |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_ISSUER_COMMON_NAME = 0, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_ISSUER_LOCALITY_NAME = 1, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_ISSUER_STATE_OR_PROVINCE_NAME = 2, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_ISSUER_COUNTRY_NAME = 3, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_NAME = 4, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_UNIT_NAME_ = 5, |
|
yzshen1
2012/03/20 06:48:01
Please remove the trailing underscore. (There are
raymes
2012/03/21 20:28:08
Done.
|
| + |
| + /** |
| + * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| + */ |
| + PP_FLASH_X509CERTIFICATE_ISSUER_UNIQUE_ID_ = 6, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_COMMON_NAME = 7, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_LOCALITY_NAME = 8, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_STATE_OR_PROVINCE_NAME = 9, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_COUNTRY_NAME = 10, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_NAME = 11, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_UNIT_NAME_ = 12, |
| + |
| + /** |
| + * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| + */ |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_UNIQUE_ID_ = 13, |
| + |
| + /** |
| + * This corresponds to an integer (<code>PP_VARTYPE_INT32</code>) which |
| + * which can be cast to a <code>PPB_Flash_X509_Certificate_Version</code>. |
| + */ |
| + PP_FLASH_X509CERTIFICATE_VERSION = 14, |
| + |
| + /** |
| + * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| + * The serial number has the leading 0 removed. |
| + */ |
| + PP_FLASH_X509CERTIFICATE_SERIAL_NUMBER = 15, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_ALGORITHM_OID = 16, |
| + |
| + /** |
| + * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>) |
| + * which is DER-encoded. |
| + */ |
| + PP_FLASH_X509CERTIFICATE_ALGORITHM_PARAMATERS_RAW = 17, |
| + |
| + /** This corresponds to a date (<code>PP_TIME</code>). */ |
| + PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_BEFORE = 18, |
| + |
| + /** This corresponds to a date (<code>PP_TIME</code>). */ |
| + PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_AFTER = 19, |
| + |
| + /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| + PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 19, |
| + |
| + /** |
| + * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| + */ |
| + PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY = 20, |
| + |
| + /** |
| + * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>). |
| + * This is the DER-encoded representation of the certificate. |
| + */ |
| + PP_FLASH_X509CERTIFICATE_RAW = 21 |
| +}; |
| + |
| +/** |
| + * This enumeration defines the different possible values for X5O9 certificate |
| + * versions as returned by: |
| + * <code>GetField(resource, PP_FLASH_X509CERTIFICATE_VERSION)</code>. |
| + */ |
| +[assert_size(4)] |
| +enum PPB_Flash_X509_Certificate_Version { |
|
yzshen1
2012/03/20 06:48:01
Please remove the underscore between X509 and Cert
raymes
2012/03/21 20:28:08
Done.
|
| + PP_FLASH_X509_CERTIFICATE_V1 = 0, |
| + PP_FLASH_X509_CERTIFICATE_V2 = 1, |
| + PP_FLASH_X509_CERTIFICATE_V3 = 2 |
| +}; |
| + |
| +/** |
| + * The <code>PPB_Flash_X509Certificate</code> interface provides access to |
| + * the fields of an X509 certificate. |
| + */ |
| +interface PPB_Flash_X509Certificate { |
| + /** |
| + * Allocates a <code>PPB_Flash_X509Certificate</code> resource. |
| + * <code>Init()</code> must be called before using the certificate. |
| + */ |
| + PP_Resource Create([in] PP_Instance instance); |
| + |
| + /** |
| + * Returns <code>PP_TRUE</code> if a given resource is a |
| + * <code>PPB_Flash_X509Certificate</code>. |
| + */ |
| + PP_Bool IsFlashX509Certificate([in] PP_Resource resource); |
| + |
| + /** |
| + * Initialize a <code>PPB_Flash_X509Certificate</code> from the DER-encoded |
|
yzshen1
2012/03/20 06:48:01
nit: Initialize -> Initializes.
|
| + * representation. |bytes| should represent only a single certificate. |
| + * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of |
| + * a certificate. Note: Flash requires this to be synchronous. |
| + */ |
| + PP_Bool Init([in] PP_Resource resource, |
|
yzshen1
2012/03/20 06:48:01
- Is it necessary to be synchronous? If anything c
raymes
2012/03/21 20:28:08
The flash side is a sync-call from AS. I discussed
|
| + [in] str_t bytes, |
| + [in] uint32_t length); |
| + |
| + /** |
| + * Get a field of the X509Certificate as a <code>PP_Var</code>. A null |
| + * <code>PP_Var</code> is returned if the field is unavailable. |
| + */ |
| + PP_Var GetField([in] PP_Resource resource, |
| + [in] PP_Flash_X509Certificate_Field field); |
| +}; |