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.
7 * This file defines the <code>PPB_X509Certificate_Private</code> interface for
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.
21 enum PP_X509Certificate_Private_Field
{
22 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
23 PP_X509CERTIFICATE_PRIVATE_ISSUER_COMMON_NAME
= 0,
25 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
26 PP_X509CERTIFICATE_PRIVATE_ISSUER_LOCALITY_NAME
= 1,
28 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
29 PP_X509CERTIFICATE_PRIVATE_ISSUER_STATE_OR_PROVINCE_NAME
= 2,
31 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
32 PP_X509CERTIFICATE_PRIVATE_ISSUER_COUNTRY_NAME
= 3,
34 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
35 PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_NAME
= 4,
37 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
38 PP_X509CERTIFICATE_PRIVATE_ISSUER_ORGANIZATION_UNIT_NAME
= 5,
41 * Note: This field is unimplemented and will return
42 * <code>PP_VARTYPE_NULL</code>.
44 PP_X509CERTIFICATE_PRIVATE_ISSUER_UNIQUE_ID
= 6,
46 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
47 PP_X509CERTIFICATE_PRIVATE_SUBJECT_COMMON_NAME
= 7,
49 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
50 PP_X509CERTIFICATE_PRIVATE_SUBJECT_LOCALITY_NAME
= 8,
52 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
53 PP_X509CERTIFICATE_PRIVATE_SUBJECT_STATE_OR_PROVINCE_NAME
= 9,
55 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
56 PP_X509CERTIFICATE_PRIVATE_SUBJECT_COUNTRY_NAME
= 10,
58 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
59 PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME
= 11,
61 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
62 PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME
= 12,
65 * Note: This field is unimplemented and will return
66 * <code>PP_VARTYPE_NULL</code>.
68 PP_X509CERTIFICATE_PRIVATE_SUBJECT_UNIQUE_ID
= 13,
71 * Note: This field is unimplemented and will return
72 * <code>PP_VARTYPE_NULL</code>.
74 PP_X509CERTIFICATE_PRIVATE_VERSION
= 14,
77 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
78 * The serial number may include a leading 0.
80 PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER
= 15,
83 * Note: This field is unimplemented and will return
84 * <code>PP_VARTYPE_NULL</code>.
86 PP_X509CERTIFICATE_PRIVATE_SIGNATURE_ALGORITHM_OID
= 16,
89 * Note: This field is unimplemented and will return
90 * <code>PP_VARTYPE_NULL</code>.
92 PP_X509CERTIFICATE_PRIVATE_SIGNATURE_ALGORITHM_PARAMATERS_RAW
= 17,
95 * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which
96 * can be cast to a <code>PP_TIME</code>.
98 PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_BEFORE
= 18,
101 * This corresponds to a double (<code>PP_VARTYPE_DOUBLE</code>) which
102 * can be cast to a <code>PP_TIME</code>.
104 PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_AFTER
= 19,
106 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
107 PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY_ALGORITHM_OID
= 20,
110 * Note: This field is unimplemented and will return
111 * <code>PP_VARTYPE_NULL</code>.
113 PP_X509CERTIFICATE_PRIVATE_SUBJECT_PUBLIC_KEY
= 21,
116 * This corresponds to a byte array (<code>PP_VARTYPE_ARRAY_BUFFER</code>).
117 * This is the DER-encoded representation of the certificate.
119 PP_X509CERTIFICATE_PRIVATE_RAW
= 22,
121 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
122 PP_X509CERTIFICATE_PRIVATE_ISSUER_DISTINGUISHED_NAME
= 23,
124 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */
125 PP_X509CERTIFICATE_PRIVATE_SUBJECT_DISTINGUISHED_NAME
= 24
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>.
134 enum PPB_X509Certificate_Private_Version
{
135 PP_X509CERTIFICATE_PRIVATE_V1
= 0,
136 PP_X509CERTIFICATE_PRIVATE_V2
= 1,
137 PP_X509CERTIFICATE_PRIVATE_V3
= 2
141 * The <code>PPB_X509Certificate_Private</code> interface provides access to
142 * the fields of an X509 certificate.
144 interface PPB_X509Certificate_Private
{
146 * Allocates a <code>PPB_X509Certificate_Private</code> resource.
147 * <code>Initialize()</code> must be called before using the certificate.
149 PP_Resource Create
([in] PP_Instance instance
);
152 * Returns <code>PP_TRUE</code> if a given resource is a
153 * <code>PPB_X509Certificate_Private</code>.
155 PP_Bool IsX509CertificatePrivate
([in] PP_Resource resource
);
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.
163 PP_Bool Initialize
([in] PP_Resource resource
,
165 [in] uint32_t length
);
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.
171 PP_Var GetField
([in] PP_Resource resource
,
172 [in] PP_X509Certificate_Private_Field field
);