Chromium Code Reviews| 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 #ifndef NET_BASE_X509_UTIL_OPENSSL_H_ | 5 #ifndef NET_BASE_X509_UTIL_OPENSSL_H_ |
| 6 #define NET_BASE_X509_UTIL_OPENSSL_H_ | 6 #define NET_BASE_X509_UTIL_OPENSSL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <openssl/asn1.h> | 9 #include <openssl/asn1.h> |
| 10 #include <openssl/x509v3.h> | 10 #include <openssl/x509v3.h> |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "net/base/net_export.h" | |
| 16 | |
| 15 namespace base { | 17 namespace base { |
| 16 class Time; | 18 class Time; |
| 17 } // namespace base | 19 } // namespace base |
| 18 | 20 |
| 19 namespace net { | 21 namespace net { |
| 20 | 22 |
| 21 // A collection of helper functions to fetch data from OpenSSL X509 certificates | 23 // A collection of helper functions to fetch data from OpenSSL X509 certificates |
| 22 // into more convenient std / base datatypes. | 24 // into more convenient std / base datatypes. |
| 23 namespace x509_util { | 25 namespace x509_util { |
| 24 | 26 |
| 25 bool ParsePrincipalKeyAndValueByIndex(X509_NAME* name, | 27 bool NET_EXPORT ParsePrincipalKeyAndValueByIndex(X509_NAME* name, |
| 26 int index, | 28 int index, |
| 27 std::string* key, | 29 std::string* key, |
| 28 std::string* value); | 30 std::string* value); |
| 29 | 31 |
| 30 bool ParsePrincipalValueByIndex(X509_NAME* name, int index, std::string* value); | 32 bool NET_EXPORT ParsePrincipalValueByIndex(X509_NAME* name, |
|
wtc
2011/10/06 17:41:07
Nit: ParsePrincipalValueByIndex isn't used outside
| |
| 33 int index, | |
| 34 std::string* value); | |
| 31 | 35 |
| 32 bool ParsePrincipalValueByNID(X509_NAME* name, int nid, std::string* value); | 36 bool NET_EXPORT ParsePrincipalValueByNID(X509_NAME* name, |
| 37 int nid, | |
| 38 std::string* value); | |
| 33 | 39 |
| 34 bool ParseDate(ASN1_TIME* x509_time, base::Time* time); | 40 bool NET_EXPORT ParseDate(ASN1_TIME* x509_time, base::Time* time); |
| 35 | 41 |
| 36 } // namespace x509_util | 42 } // namespace x509_util |
| 37 | 43 |
| 38 } // namespace net | 44 } // namespace net |
| 39 | 45 |
| 40 #endif // NET_BASE_X509_UTIL_OPENSSL_H_ | 46 #endif // NET_BASE_X509_UTIL_OPENSSL_H_ |
| OLD | NEW |