Update nss_revision to 235242.
[chromium-blink-merge.git] / net / cert / x509_util_openssl.h
blobec4538003f376e40d9e0431a5d2170bbcf0fac1d
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
3 // found in the LICENSE file.
5 #ifndef NET_CERT_X509_UTIL_OPENSSL_H_
6 #define NET_CERT_X509_UTIL_OPENSSL_H_
8 #include <openssl/asn1.h>
9 #include <openssl/x509v3.h>
11 #include <string>
12 #include <vector>
14 #include "net/base/net_export.h"
16 namespace base {
17 class Time;
18 } // namespace base
20 namespace net {
22 // A collection of helper functions to fetch data from OpenSSL X509 certificates
23 // into more convenient std / base datatypes.
24 namespace x509_util {
26 bool NET_EXPORT ParsePrincipalKeyAndValueByIndex(X509_NAME* name,
27 int index,
28 std::string* key,
29 std::string* value);
31 bool NET_EXPORT ParsePrincipalValueByIndex(X509_NAME* name,
32 int index,
33 std::string* value);
35 bool NET_EXPORT ParsePrincipalValueByNID(X509_NAME* name,
36 int nid,
37 std::string* value);
39 bool NET_EXPORT ParseDate(ASN1_TIME* x509_time, base::Time* time);
41 } // namespace x509_util
43 } // namespace net
45 #endif // NET_CERT_X509_UTIL_OPENSSL_H_