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..380ab0d50586549108d89a66679870790d857ffb |
| --- /dev/null |
| +++ b/ppapi/api/private/ppb_flash_x509_certificate.idl |
| @@ -0,0 +1,96 @@ |
| +/* 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 |
| +}; |
| + |
| +[assert_size(4)] |
| +enum PP_Flash_X509Certificate_Field { |
| + // Issuer/principal common name, locality name, state or province name, |
| + // country name, organization name and organization unit name are returned as |
| + // <code>PP_VARTYPE_STRING</code>. |
|
Ryan Sleevi
2012/03/16 00:08:40
This is definitely outside of my domain, so feel f
raymes
2012/03/16 17:18:26
I definitely agree that consistency is better =).
|
| + PP_FLASH_X509CERTIFICATE_ISSUER_COMMON_NAME_= 0, |
| + PP_FLASH_X509CERTIFICATE_ISSUER_LOCALITY_NAME_= 1, |
| + PP_FLASH_X509CERTIFICATE_ISSUER_STATE_OR_PROVINCE_NAME_= 2, |
| + PP_FLASH_X509CERTIFICATE_ISSUER_COUNTRY_NAME_= 3, |
| + PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_NAME_= 4, |
| + PP_FLASH_X509CERTIFICATE_ISSUER_ORGANIZATION_UNIT_NAME_ = 5, |
| + // The issuer/principal unique ID is returned as a |
| + // <code>PP_VARTYPE_ARRAY_BUFFER</code>. |
| + PP_FLASH_X509CERTIFICATE_ISSUER_UNIQUE_ID_ = 6, |
| + |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_COMMON_NAME_= 7, |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_LOCALITY_NAME_= 8, |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_STATE_OR_PROVINCE_NAME_= 9, |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_COUNTRY_NAME_= 10, |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_NAME_= 11, |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_ORGANIZATION_UNIT_NAME_ = 12, |
| + PP_FLASH_X509CERTIFICATE_PRINCIPAL_UNIQUE_ID_ = 13, |
| + |
| + // The certificate version is returned as a <code>PP_VARTYPE_INT32</code> with |
| + // 0=X509v1, 1=X509v2, 2=X509v3. |
|
Ryan Sleevi
2012/03/16 00:08:40
Can this be a real pepper enum type?
Or is that e
raymes
2012/03/16 17:18:26
Pepper can return an int which could be cast to an
|
| + PP_FLASH_X509CERTIFICATE_VERSION = 14, |
| + // The certificate serial number is returned as a |
| + // <code>PP_VARTYPE_ARRAY_BUFFER</code> with the leading 0 removed. |
| + PP_FLASH_X509CERTIFICATE_SERIAL_NUMBER = 15, |
| + // The algorithm OID is returned as a <code>PP_VARTYPE_STRING</code>. |
| + PP_FLASH_X509CERTIFICATE_ALGORITHM_OID = 16, |
| + // The algorithm paramaters encoded in DER are returned as a |
| + // <code>PP_VARTYPE_STRING</code>. |
|
Ryan Sleevi
2012/03/16 00:08:40
PP_VARTYPE_STRING -> PP_VARTYPE_ARRAY_BUFFER
raymes
2012/03/16 17:18:26
Done.
|
| + PP_FLASH_X509CERTIFICATE_ALGORITHM_PARAMATERS_RAW = 17, |
| + // The validity not before and not after dates are returned as |
| + // <code>PP_TIME</code>. |
| + PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_BEFORE = 18, |
| + PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_AFTER = 19, |
| + // The subject public key algorithm OID is returned as a |
| + // <code>PP_VARTYPE_STRING</code>. |
| + PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 19, |
| + // The public key is returned as a <code>PP_VARTYPE_ARRAY_BUFFER</code>. |
| + PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY = 20, |
| + // The raw certificate encoded in DER format is returned as a |
| + // <code>PP_VARTYPE_ARRAY_BUFFER</code>. |
| + PP_FLASH_X509CERTIFICATE_RAW = 21 |
| +}; |
| + |
| +/** |
| + * 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 |
| + * 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, |
| + [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); |
| +}; |