• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6/**
7 * This file defines the <code>PPB_X509Certificate_Private</code> interface for
8 * an X509 certificate.
9 */
10
11label Chrome {
12  M19 = 0.1
13};
14
15/**
16 * This enumeration corresponds to fields of an X509 certificate. Refer to
17 * <a href="http://www.ietf.org/rfc/rfc5280.txt>RFC 5280</a> for further
18 * documentation about particular fields.
19 */
20[assert_size(4)]
21enum PP_X509Certificate_Private_Field {
22  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
23  PP_X509CERTIFICATE_PRIVATE_ISSUER_COMMON_NAME = 0,
24
25  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
26  PP_X509CERTIFICATE_PRIVATE_ISSUER_LOCALITY_NAME = 1,
27
28  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
29  PP_X509CERTIFICATE_PRIVATE_ISSUER_STATE_OR_PROVINCE_NAME = 2,
30
31  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
32  PP_X509CERTIFICATE_PRIVATE_ISSUER_COUNTRY_NAME = 3,
33
34  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
35  PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_NAME = 4,
36
37  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
38  PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_UNIT_NAME = 5,
39
40  /**
41   * Note: This field is unimplemented and will return
42   * <code>PP_VARTYPE_NULL</code>.
43   */
44  PP_X509CERTIFICATE_PRIVATE_ISSUER_UNIQUE_ID = 6,
45
46  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
47  PP_X509CERTIFICATE_PRIVATE_SUBJECT_COMMON_NAME = 7,
48
49  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
50  PP_X509CERTIFICATE_PRIVATE_SUBJECT_LOCALITY_NAME = 8,
51
52  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
53  PP_X509CERTIFICATE_PRIVATE_SUBJECT_STATE_OR_PROVINCE_NAME = 9,
54
55  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
56  PP_X509CERTIFICATE_PRIVATE_SUBJECT_COUNTRY_NAME = 10,
57
58  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
59  PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME = 11,
60
61  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
62  PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME = 12,
63
64  /**
65   * Note: This field is unimplemented and will return
66   * <code>PP_VARTYPE_NULL</code>.
67   */
68  PP_X509CERTIFICATE_PRIVATE_SUBJECT_UNIQUE_ID = 13,
69
70  /**
71   * Note: This field is unimplemented and will return
72   * <code>PP_VARTYPE_NULL</code>.
73   */
74  PP_X509CERTIFICATE_PRIVATE_VERSION = 14,
75
76  /**
77   * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
78   * The serial number may include a leading 0.
79   */
80  PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER = 15,
81
82  /**
83   * Note: This field is unimplemented and will return
84   * <code>PP_VARTYPE_NULL</code>.
85   */
86  PP_X509CERTIFICATE_PRIVATE_SIGNATURE_ALGORITHM_OID = 16,
87
88  /**
89   * Note: This field is unimplemented and will return
90   * <code>PP_VARTYPE_NULL</code>.
91   */
92  PP_X509CERTIFICATE_PRIVATE_SIGNATURE_ALGORITHM_PARAMATERS_RAW = 17,
93
94  /**
95   * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which
96   * can be cast to a <code>PP_TIME</code>.
97   */
98  PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_BEFORE = 18,
99
100  /**
101   * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which
102   * can be cast to a <code>PP_TIME</code>.
103   */
104  PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_AFTER = 19,
105
106  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
107  PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID = 20,
108
109  /**
110   * Note: This field is unimplemented and will return
111   * <code>PP_VARTYPE_NULL</code>.
112   */
113  PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY = 21,
114
115  /**
116   * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
117   * This is the DER-encoded representation of the certificate.
118   */
119  PP_X509CERTIFICATE_PRIVATE_RAW = 22,
120
121  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
122  PP_X509CERTIFICATE_PRIVATE_ISSUER_DISTINGUISHED_NAME = 23,
123
124  /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
125  PP_X509CERTIFICATE_PRIVATE_SUBJECT_DISTINGUISHED_NAME = 24
126};
127
128/**
129 * This enumeration defines the different possible values for X5O9 certificate
130 * versions as returned by:
131 * <code>GetField(resource, PP_X509CERTIFICATE_PRIVATE_VERSION)</code>.
132 */
133[assert_size(4)]
134enum PPB_X509Certificate_Private_Version {
135  PP_X509CERTIFICATE_PRIVATE_V1 = 0,
136  PP_X509CERTIFICATE_PRIVATE_V2 = 1,
137  PP_X509CERTIFICATE_PRIVATE_V3 = 2
138};
139
140/**
141 * The <code>PPB_X509Certificate_Private</code> interface provides access to
142 * the fields of an X509 certificate.
143 */
144interface PPB_X509Certificate_Private {
145  /**
146   * Allocates a <code>PPB_X509Certificate_Private</code> resource.
147   * <code>Initialize()</code> must be called before using the certificate.
148   */
149  PP_Resource Create([in] PP_Instance instance);
150
151  /**
152   * Returns <code>PP_TRUE</code> if a given resource is a
153   * <code>PPB_X509Certificate_Private</code>.
154   */
155  PP_Bool IsX509CertificatePrivate([in] PP_Resource resource);
156
157  /**
158   * Initializes a <code>PPB_X509Certificate_Private</code> from the DER-encoded
159   * representation. |bytes| should represent only a single certificate.
160   * <code>PP_FALSE</code> is returned if |bytes| is not a valid DER-encoding of
161   * a certificate. Note: Flash requires this to be synchronous.
162   */
163  PP_Bool Initialize([in] PP_Resource resource,
164                     [in] str_t bytes,
165                     [in] uint32_t length);
166
167  /**
168   * Get a field of the X509Certificate as a <code>PP_Var</code>. A null
169   * <code>PP_Var</code> is returned if the field is unavailable.
170   */
171  PP_Var GetField([in] PP_Resource resource,
172                  [in] PP_X509Certificate_Private_Field field);
173};
174