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

Unified Diff: ppapi/api/private/ppb_flash_x509_certificate.idl

Issue 9405038: Add PPAPI interface for secure sockets in flash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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/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..c6c69f932931770b845d76419f4475f76ddd9f50
--- /dev/null
+++ b/ppapi/api/private/ppb_flash_x509_certificate.idl
@@ -0,0 +1,131 @@
+/* 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
+};
+
+/**
+ * Struct for storing information about a certificate issuer or subject.
+ * All members are <code>PP_Var</code> strings.
+ */
+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
+ PP_Var common_name;
+ PP_Var locality_name;
+ PP_Var state_or_province_name;
+ PP_Var country_name;
+ PP_Var organization_name;
+ PP_Var organization_unit_name;
+};
+
+[assert_size(4)]
+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.
+ PP_FLASH_X509_CERTIFICATE_V1 = 0,
+ PP_FLASH_X509CERTIFICATE_V2 = 1,
+ PP_FLASH_X509CERTIFICATE_V3 = 2
+};
+
+/**
+ * The <code>PPB_Flash_X509Certificate</code> interface provides access to
+ * the fields of an X509 certificate.
+ */
+interface PPB_Flash_X509Certificate {
+ /**
+ * Create a <code>PPB_Flash_X509Certificate</code> from the DER-encoded
+ * representation. Returns a null resource if the byte array is not a valid
+ * X509 certificate.
+ */
+ PP_Resource Create([in] PP_Instance instance,
+ [in] mem_t bytes,
+ [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.
+
+ /**
+ * Returns <code>PP_TRUE</code> if a given resource is a
+ * <code>PPB_Flash_X509Certificate</code>.
+ */
+ PP_Bool IsFlashX509Certificate([in] PP_Resource resource);
+
+ /**
+ * Get the certificate version.
+ */
+ PPB_Flash_X509Certificate_Version GetVersion([in] PP_Resource certificate);
+
+ /**
+ * Get the certificate serial number as a byte array.
+ */
+ 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.
+ [out] uint32_t length);
+
+ /**
+ * Get the certificate algorithm ID as a <code>PP_Var</code> string.
+ */
+ 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.
+
+ /**
+ * Get the certificate algorithm paramaters as a byte array.
+ */
+ 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.
+ [out] uint32_t length);
+
+ /**
+ * Get the valid start date as a timestamp.
+ */
+ uint32_t GetVaildStart([in] PP_Resource certificate);
+
+ /**
+ * Get the valid end date as a timestamp.
+ */
+ uint32_t GetVaildEnd([in] PP_Resource certificate);
+
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.
+ /**
+ * Get the subject public key algorithm ID as a <code>PP_Var</code> string.
+ */
+ 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.
+
+ /**
+ * Get the subject public key as a byte array.
+ */
+ PP_Var GetSubjectPublicKey([in] PP_Resource certificate,
+ [out] uint32_t length);
+
+ /**
+ * Get the certificate as a byte array encoded in DER format.
+ */
+ mem_t GetDER([in] PP_Resource certificate,
+ [out] uint32_t length);
+
+ /**
+ * Get the subject public key as a byte array.
+ */
+ 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.
+ [out] uint32_t length);
+
+ /**
+ * Get the issuers unique ID as a byte array.
+ */
+ mem_t GetIssuerUniqueID([in] PP_Resource certificate,
+ [out] uint32_t length);
+
+ /**
+ * 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
+ */
+ mem_t GetSubjectUniqueID([in] PP_Resource certificate,
+ [out] uint32_t length);
+
+ /**
+ * Get information about the certificate issuer.
+ */
+ PP_Flash_X509Certificate_Principal GetIssuerInfo(PP_Resource certificate);
+
+ /**
+ * Get information about the certificate subject.
+ */
+ PP_Flash_X509Certificate_Principal GetSubjectInfo(PP_Resource certificate);
+};

Powered by Google App Engine
This is Rietveld 408576698