| OLD | NEW |
| 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.h" |
| 6 #include "net/base/x509_util_openssl.h" | 6 #include "net/base/x509_util_openssl.h" |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/string_piece.h" | 11 #include "base/string_piece.h" |
| 12 #include "net/base/x509_cert_types.h" | 12 #include "net/base/x509_cert_types.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 namespace x509_util { | 16 namespace x509_util { |
| 17 | 17 |
| 18 bool CreateOriginBoundCertRSA( | 18 bool CreateOriginBoundCertRSA( |
| 19 crypto::RSAPrivateKey* key, | 19 crypto::RSAPrivateKey* key, |
| 20 const std::string& origin, | 20 const std::string& origin, |
| 21 uint32 serial_number, | 21 uint32 serial_number, |
| 22 base::TimeDelta valid_duration, | 22 base::Time not_valid_before, |
| 23 base::Time not_valid_after, |
| 23 std::string* der_cert) { | 24 std::string* der_cert) { |
| 24 NOTIMPLEMENTED(); | 25 NOTIMPLEMENTED(); |
| 25 return false; | 26 return false; |
| 26 } | 27 } |
| 27 | 28 |
| 28 bool CreateOriginBoundCertEC( | 29 bool CreateOriginBoundCertEC( |
| 29 crypto::ECPrivateKey* key, | 30 crypto::ECPrivateKey* key, |
| 30 const std::string& origin, | 31 const std::string& origin, |
| 31 uint32 serial_number, | 32 uint32 serial_number, |
| 32 base::TimeDelta valid_duration, | 33 base::Time not_valid_before, |
| 34 base::Time not_valid_after, |
| 33 std::string* der_cert) { | 35 std::string* der_cert) { |
| 34 NOTIMPLEMENTED(); | 36 NOTIMPLEMENTED(); |
| 35 return false; | 37 return false; |
| 36 } | 38 } |
| 37 | 39 |
| 38 bool ParsePrincipalKeyAndValueByIndex(X509_NAME* name, | 40 bool ParsePrincipalKeyAndValueByIndex(X509_NAME* name, |
| 39 int index, | 41 int index, |
| 40 std::string* key, | 42 std::string* key, |
| 41 std::string* value) { | 43 std::string* value) { |
| 42 X509_NAME_ENTRY* entry = X509_NAME_get_entry(name, index); | 44 X509_NAME_ENTRY* entry = X509_NAME_get_entry(name, index); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 x509_time->length); | 88 x509_time->length); |
| 87 | 89 |
| 88 CertDateFormat format = x509_time->type == V_ASN1_UTCTIME ? | 90 CertDateFormat format = x509_time->type == V_ASN1_UTCTIME ? |
| 89 CERT_DATE_FORMAT_UTC_TIME : CERT_DATE_FORMAT_GENERALIZED_TIME; | 91 CERT_DATE_FORMAT_UTC_TIME : CERT_DATE_FORMAT_GENERALIZED_TIME; |
| 90 return ParseCertificateDate(str_date, format, time); | 92 return ParseCertificateDate(str_date, format, time); |
| 91 } | 93 } |
| 92 | 94 |
| 93 } // namespace x509_util | 95 } // namespace x509_util |
| 94 | 96 |
| 95 } // namespace net | 97 } // namespace net |
| OLD | NEW |