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

Side by Side Diff: net/cert/x509_util_nss.h

Issue 2758803003: Make X509Certificate creation fail if X509Certificate::Initialize fails. (Closed)
Patch Set: test updatess 2 Created 3 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 unified diff | Download patch
« no previous file with comments | « net/cert/x509_certificate_win.cc ('k') | net/cert/x509_util_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_CERT_X509_UTIL_NSS_H_ 5 #ifndef NET_CERT_X509_UTIL_NSS_H_
6 #define NET_CERT_X509_UTIL_NSS_H_ 6 #define NET_CERT_X509_UTIL_NSS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 11 matching lines...) Expand all
22 typedef struct CERTNameStr CERTName; 22 typedef struct CERTNameStr CERTName;
23 typedef struct PK11SlotInfoStr PK11SlotInfo; 23 typedef struct PK11SlotInfoStr PK11SlotInfo;
24 typedef struct PLArenaPool PLArenaPool; 24 typedef struct PLArenaPool PLArenaPool;
25 typedef struct SECItemStr SECItem; 25 typedef struct SECItemStr SECItem;
26 26
27 namespace net { 27 namespace net {
28 28
29 namespace x509_util { 29 namespace x509_util {
30 30
31 // Parses the Principal attribute from |name| and outputs the result in 31 // Parses the Principal attribute from |name| and outputs the result in
32 // |principal|. 32 // |principal|. Returns true on success.
33 void ParsePrincipal(CERTName* name, 33 bool ParsePrincipal(CERTName* name, CertPrincipal* principal);
34 CertPrincipal* principal);
35 34
36 // Parses the date from |der_date| and outputs the result in |result|. 35 // Parses the date from |der_date| and outputs the result in |result|.
37 void ParseDate(const SECItem* der_date, base::Time* result); 36 // Returns true on success.
37 bool ParseDate(const SECItem* der_date, base::Time* result);
38 38
39 // Parses the serial number from |certificate|. 39 // Parses the serial number from |certificate|.
40 std::string ParseSerialNumber(const CERTCertificate* certificate); 40 std::string ParseSerialNumber(const CERTCertificate* certificate);
41 41
42 // Gets the dNSName and iPAddress name fields from the subjectAltName 42 // Gets the dNSName and iPAddress name fields from the subjectAltName
43 // extension of |cert_handle|. 43 // extension of |cert_handle|.
44 // If |dns_names| is non-null, each dNSName will be stored in |*dns_names|. 44 // If |dns_names| is non-null, each dNSName will be stored in |*dns_names|.
45 // If |ip_addrs| is non-null, each iPAddress will be stored in |*ip_addrs|. 45 // If |ip_addrs| is non-null, each iPAddress will be stored in |*ip_addrs|.
46 // Returns true if any dNSName or iPAddress was present. 46 // Returns true if any dNSName or iPAddress was present.
47 bool GetSubjectAltName(CERTCertificate* cert_handle, 47 bool GetSubjectAltName(CERTCertificate* cert_handle,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // TODO(gspencer): Internationalize this: it's wrong to hard-code English. 125 // TODO(gspencer): Internationalize this: it's wrong to hard-code English.
126 std::string GetUniqueNicknameForSlot(const std::string& nickname, 126 std::string GetUniqueNicknameForSlot(const std::string& nickname,
127 const SECItem* subject, 127 const SECItem* subject,
128 PK11SlotInfo* slot); 128 PK11SlotInfo* slot);
129 129
130 } // namespace x509_util 130 } // namespace x509_util
131 131
132 } // namespace net 132 } // namespace net
133 133
134 #endif // NET_CERT_X509_UTIL_NSS_H_ 134 #endif // NET_CERT_X509_UTIL_NSS_H_
OLDNEW
« no previous file with comments | « net/cert/x509_certificate_win.cc ('k') | net/cert/x509_util_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698