Index: net/cert/x509_util.h |
diff --git a/net/cert/x509_util.h b/net/cert/x509_util.h |
index 3ae9a146d863413b0d6f1c816d974b532bdd8978..07f4e21b1d32d42ca964d476eaf0eb88bc7d675e 100644 |
--- a/net/cert/x509_util.h |
+++ b/net/cert/x509_util.h |
@@ -9,8 +9,10 @@ |
#include <memory> |
#include <string> |
+#include <vector> |
#include "base/memory/ref_counted.h" |
+#include "base/strings/string_piece.h" |
#include "base/time/time.h" |
#include "net/base/net_export.h" |
@@ -73,6 +75,17 @@ NET_EXPORT bool CreateSelfSignedCert(crypto::RSAPrivateKey* key, |
base::Time not_valid_after, |
std::string* der_cert); |
+// Provides a method to parse a DER-encoded X509 certificate without calling any |
+// OS primitives. This is useful in sandboxed processes. |
+NET_EXPORT bool ParseCertificateSandboxed( |
+ const base::StringPiece& certificate, |
+ std::string* subject, |
+ std::string* issuer, |
+ base::Time* not_before, |
+ base::Time* not_after, |
+ std::vector<std::string>* dns_names, |
+ std::vector<std::string>* ip_addresses); |
+ |
// Comparator for use in STL algorithms that will sort client certificates by |
// order of preference. |
// Returns true if |a| is more preferable than |b|, allowing it to be used |