| 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 CreateOriginBoundCert( | 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::TimeDelta valid_duration, |
| 23 std::string* der_cert) { | 23 std::string* der_cert) { |
| 24 NOTIMPLEMENTED(); | 24 NOTIMPLEMENTED(); |
| 25 return false; | 25 return false; |
| 26 } | 26 } |
| 27 | 27 |
| 28 bool CreateOriginBoundCertEC( |
| 29 crypto::ECPrivateKey* key, |
| 30 const std::string& origin, |
| 31 uint32 serial_number, |
| 32 base::TimeDelta valid_duration, |
| 33 std::string* der_cert) { |
| 34 NOTIMPLEMENTED(); |
| 35 return false; |
| 36 } |
| 37 |
| 28 bool ParsePrincipalKeyAndValueByIndex(X509_NAME* name, | 38 bool ParsePrincipalKeyAndValueByIndex(X509_NAME* name, |
| 29 int index, | 39 int index, |
| 30 std::string* key, | 40 std::string* key, |
| 31 std::string* value) { | 41 std::string* value) { |
| 32 X509_NAME_ENTRY* entry = X509_NAME_get_entry(name, index); | 42 X509_NAME_ENTRY* entry = X509_NAME_get_entry(name, index); |
| 33 if (!entry) | 43 if (!entry) |
| 34 return false; | 44 return false; |
| 35 | 45 |
| 36 if (key) { | 46 if (key) { |
| 37 ASN1_OBJECT* object = X509_NAME_ENTRY_get_object(entry); | 47 ASN1_OBJECT* object = X509_NAME_ENTRY_get_object(entry); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 x509_time->length); | 86 x509_time->length); |
| 77 | 87 |
| 78 CertDateFormat format = x509_time->type == V_ASN1_UTCTIME ? | 88 CertDateFormat format = x509_time->type == V_ASN1_UTCTIME ? |
| 79 CERT_DATE_FORMAT_UTC_TIME : CERT_DATE_FORMAT_GENERALIZED_TIME; | 89 CERT_DATE_FORMAT_UTC_TIME : CERT_DATE_FORMAT_GENERALIZED_TIME; |
| 80 return ParseCertificateDate(str_date, format, time); | 90 return ParseCertificateDate(str_date, format, time); |
| 81 } | 91 } |
| 82 | 92 |
| 83 } // namespace x509_util | 93 } // namespace x509_util |
| 84 | 94 |
| 85 } // namespace net | 95 } // namespace net |
| OLD | NEW |