Index: net/cert/x509_util_openssl.h |
diff --git a/net/cert/x509_util_openssl.h b/net/cert/x509_util_openssl.h |
index 8dc4473514ad1fee613dc4c6891bf0eef07903e9..9db5a56033f43956c4a4fd304adc90d7b57887c8 100644 |
--- a/net/cert/x509_util_openssl.h |
+++ b/net/cert/x509_util_openssl.h |
@@ -11,6 +11,7 @@ |
#include <string> |
#include <vector> |
+#include "base/strings/string_piece.h" |
#include "net/base/net_export.h" |
namespace base { |
@@ -42,6 +43,19 @@ bool NET_EXPORT ParsePrincipalValueByNID(X509_NAME* name, |
bool NET_EXPORT ParseDate(ASN1_TIME* x509_time, base::Time* time); |
+// DER-encodes |x509|. On success, returns true and writes the |
+// encoding to |*out_der|. |
+bool NET_EXPORT GetDER(X509* x509, std::string* out_der); |
+ |
Ryan Sleevi
2014/09/19 15:56:54
Why does this need to be exported? It is just a wr
davidben
2014/09/19 16:53:40
Well, that there is a cache isn't entirely opaque
Ryan Sleevi
2014/09/19 17:39:33
Yeah, I would rather wait until we have a demonstr
davidben
2014/09/19 18:10:09
Done.
|
+// DER-encodes |x509|, caching the encoding in a structure owned by |
+// the X509. On success, returns true, and sets |*out_der| to point to |
+// the encoding. The StringPiece is valid as long as |x509| is not |
+// freed. |
+// |
+// Note: this caches the encoding, so |x509| must not be modified |
+// after the first call to this function. |
+bool NET_EXPORT GetDERAndCacheIfNeeded(X509* x509, base::StringPiece* out_der); |
+ |
} // namespace x509_util |
} // namespace net |