Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Unified Diff: ppapi/c/private/ppb_flash_x509_certificate.h

Issue 9693024: Add the PPAPI X509 Certificate interface and implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/c/private/ppb_flash_x509_certificate.h
diff --git a/ppapi/c/private/ppb_flash_x509_certificate.h b/ppapi/c/private/ppb_flash_x509_certificate.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7aade283a6b08501858b6d99420a40487dbe738
--- /dev/null
+++ b/ppapi/c/private/ppb_flash_x509_certificate.h
@@ -0,0 +1,107 @@
+/* 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.
+ */
+
+/* From private/ppb_flash_x509_certificate.idl,
+ * modified Wed Mar 14 15:08:23 2012.
+ */
+
+#ifndef PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_
+#define PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_
+
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_macros.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_stdint.h"
+#include "ppapi/c/pp_var.h"
+
+#define PPB_FLASH_X509CERTIFICATE_INTERFACE_0_1 "PPB_Flash_X509Certificate;0.1"
+#define PPB_FLASH_X509CERTIFICATE_INTERFACE \
+ PPB_FLASH_X509CERTIFICATE_INTERFACE_0_1
+
+/**
+ * @file
+ * This file defines the <code>PPB_Flash_X509Certificate</code> interface for
+ * an X509 certificate.
+ */
+
+
+/**
+ * @addtogroup Enums
+ * @{
+ */
+/* TODO(raymes): Document the types of the return values for each of these
+ * fields as they are implemented. */
+typedef enum {
+ 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,
+ 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,
+ PP_FLASH_X509CERTIFICATE_VERSION = 14,
+ PP_FLASH_X509CERTIFICATE_SERIAL_NUMBER = 15,
+ PP_FLASH_X509CERTIFICATE_ALGORITHM_OID = 16,
+ PP_FLASH_X509CERTIFICATE_ALGORITHM_PARAMATERS = 17,
+ PP_FLASH_X509CERTIFICATE_VALIDITY_DATE_RANGE = 18,
+ PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 19,
+ PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY = 20,
+ PP_FLASH_X509CERTIFICATE_DER = 21,
+ PP_FLASH_X509CERTIFICATE_FIELD_COUNT = 22
+} PP_Flash_X509Certificate_Field;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_X509Certificate_Field, 4);
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+/**
+ * The <code>PPB_Flash_X509Certificate</code> interface provides access to
+ * the fields of an X509 certificate.
+ */
+struct PPB_Flash_X509Certificate_0_1 {
+ /**
+ * Allocates a <code>PPB_Flash_X509Certificate</code> resource.
+ * <code>Init()</code> must be called before using the certificate.
+ */
+ PP_Resource (*Create)(PP_Instance instance);
+ /**
+ * Returns <code>PP_TRUE</code> if a given resource is a
+ * <code>PPB_Flash_X509Certificate</code>.
+ */
+ PP_Bool (*IsFlashX509Certificate)(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)(PP_Resource resource, const char* bytes, uint32_t length);
+ /**
+ * Get a field of the X509Certificate as a |PP_Var|. A null |PP_Var|
+ * is returned if the field is unavailable.
+ */
+ struct PP_Var (*GetField)(PP_Resource resource,
+ PP_Flash_X509Certificate_Field field);
+};
+
+typedef struct PPB_Flash_X509Certificate_0_1 PPB_Flash_X509Certificate;
+/**
+ * @}
+ */
+
+#endif /* PPAPI_C_PRIVATE_PPB_FLASH_X509_CERTIFICATE_H_ */
+

Powered by Google App Engine
This is Rietveld 408576698