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

Side by Side Diff: net/base/x509_util_openssl.cc

Issue 8296014: Use NSS to generate Origin-Bound Certs on Win and Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 9 years, 2 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 | Annotate | Revision Log
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 #include "net/base/x509_util.h"
5 #include "net/base/x509_util_openssl.h" 6 #include "net/base/x509_util_openssl.h"
6 7
7 #include <algorithm> 8 #include <algorithm>
8 9
9 #include "base/logging.h" 10 #include "base/logging.h"
10 #include "base/string_piece.h" 11 #include "base/string_piece.h"
11 #include "net/base/x509_cert_types.h" 12 #include "net/base/x509_cert_types.h"
12 13
13 namespace net { 14 namespace net {
14 15
15 namespace x509_util { 16 namespace x509_util {
16 17
18 bool CreateOriginBoundCert(
19 crypto::RSAPrivateKey* key,
20 const std::string& origin,
21 uint32 serial_number,
22 base::TimeDelta valid_duration,
23 std::string* der_cert) {
24 NOTIMPLEMENTED();
25 return false;
26 }
27
17 bool ParsePrincipalKeyAndValueByIndex(X509_NAME* name, 28 bool ParsePrincipalKeyAndValueByIndex(X509_NAME* name,
18 int index, 29 int index,
19 std::string* key, 30 std::string* key,
20 std::string* value) { 31 std::string* value) {
21 X509_NAME_ENTRY* entry = X509_NAME_get_entry(name, index); 32 X509_NAME_ENTRY* entry = X509_NAME_get_entry(name, index);
22 if (!entry) 33 if (!entry)
23 return false; 34 return false;
24 35
25 if (key) { 36 if (key) {
26 ASN1_OBJECT* object = X509_NAME_ENTRY_get_object(entry); 37 ASN1_OBJECT* object = X509_NAME_ENTRY_get_object(entry);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 x509_time->length); 76 x509_time->length);
66 77
67 CertDateFormat format = x509_time->type == V_ASN1_UTCTIME ? 78 CertDateFormat format = x509_time->type == V_ASN1_UTCTIME ?
68 CERT_DATE_FORMAT_UTC_TIME : CERT_DATE_FORMAT_GENERALIZED_TIME; 79 CERT_DATE_FORMAT_UTC_TIME : CERT_DATE_FORMAT_GENERALIZED_TIME;
69 return ParseCertificateDate(str_date, format, time); 80 return ParseCertificateDate(str_date, format, time);
70 } 81 }
71 82
72 } // namespace x509_util 83 } // namespace x509_util
73 84
74 } // namespace net 85 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698