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

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..23218bdbd00c9f8b0920c9033d7b7d58dcf5f383
--- /dev/null
+++ b/ppapi/c/private/ppb_flash_x509_certificate.h
@@ -0,0 +1,171 @@
+/* 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 Thu Mar 22 14:52:41 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
+ * @{
+ */
+/**
+ * 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.
+ */
+typedef enum {
+ /** 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,
+ /**
+ * 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_SUBJECT_COMMON_NAME = 7,
+ /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
+ PP_FLASH_X509CERTIFICATE_SUBJECT_LOCALITY_NAME = 8,
+ /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
+ PP_FLASH_X509CERTIFICATE_SUBJECT_STATE_OR_PROVINCE_NAME = 9,
+ /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
+ PP_FLASH_X509CERTIFICATE_SUBJECT_COUNTRY_NAME = 10,
+ /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
+ PP_FLASH_X509CERTIFICATE_SUBJECT_ORGANIZATION_NAME = 11,
+ /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
+ PP_FLASH_X509CERTIFICATE_SUBJECT_ORGANIZATION_UNIT_NAME = 12,
+ /**
+ * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
+ */
+ PP_FLASH_X509CERTIFICATE_SUBJECT_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 may include a leading 0.
+ */
+ 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 double (<code>PP_VARTYPE_DOUBLE</code>) which
+ * can be cast to a <code>PP_TIME</code>.
+ */
+ PP_FLASH_X509CERTIFICATE_VALIDITY_NOT_BEFORE = 18,
+ /**
+ * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which
+ * can be cast to a <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 = 20,
+ /**
+ * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
+ */
+ PP_FLASH_X509CERTIFICATE_SUBJECT_PUBLIC_KEY = 21,
+ /**
+ * 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 = 22
+} PP_Flash_X509Certificate_Field;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_X509Certificate_Field, 4);
+
+/**
+ * This enumeration defines the different possible values for X5O9 certificate
+ * versions as returned by:
+ * <code>GetField(resource, PP_FLASH_X509CERTIFICATE_VERSION)</code>.
+ */
+typedef enum {
+ PP_FLASH_X509CERTIFICATE_V1 = 0,
+ PP_FLASH_X509CERTIFICATE_V2 = 1,
+ PP_FLASH_X509CERTIFICATE_V3 = 2
+} PPB_Flash_X509Certificate_Version;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPB_Flash_X509Certificate_Version, 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>Initialize()</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);
+ /**
+ * Initializes 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 (*Initialize)(PP_Resource resource,
+ const char* bytes,
+ 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.
+ */
+ 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