Index: net/base/x509_certificate_openssl.cc |
diff --git a/net/base/x509_certificate_openssl.cc b/net/base/x509_certificate_openssl.cc |
index 52d9d4edecfd3401ab1c9f231098c975c4c47206..10ce266ce0861ed9d3055bc947ac3379a2e3bf78 100644 |
--- a/net/base/x509_certificate_openssl.cc |
+++ b/net/base/x509_certificate_openssl.cc |
@@ -385,17 +385,6 @@ X509Certificate::OSCertHandles X509Certificate::CreateOSCertHandlesFromBytes( |
} |
// static |
-X509Certificate* X509Certificate::CreateFromPickle(const Pickle& pickle, |
- void** pickle_iter) { |
- const char* data; |
- int length; |
- if (!pickle.ReadData(pickle_iter, &data, &length)) |
- return NULL; |
- |
- return CreateFromBytes(data, length); |
-} |
- |
-// static |
X509Certificate* X509Certificate::CreateSelfSigned( |
crypto::RSAPrivateKey* key, |
const std::string& subject, |
@@ -405,15 +394,6 @@ X509Certificate* X509Certificate::CreateSelfSigned( |
return NULL; |
} |
-void X509Certificate::Persist(Pickle* pickle) { |
- DERCache der_cache; |
- if (!GetDERAndCacheIfNeeded(cert_handle_, &der_cache)) |
- return; |
- |
- pickle->WriteData(reinterpret_cast<const char*>(der_cache.data), |
- der_cache.data_length); |
-} |
- |
void X509Certificate::GetDNSNames(std::vector<std::string>* dns_names) const { |
dns_names->clear(); |
@@ -533,4 +513,28 @@ bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a, |
memcmp(der_cache_a.data, der_cache_b.data, der_cache_a.data_length) == 0; |
} |
+// static |
+X509Certificate::OSCertHandle |
+X509Certificate::ReadCertHandleFromPickle(const Pickle& pickle, |
+ void** pickle_iter) { |
+ const char* data; |
+ int length; |
+ if (!pickle.ReadData(pickle_iter, &data, &length)) |
+ return NULL; |
+ |
+ return CreateOSCertHandleFromBytes(data, length); |
+} |
+ |
+// static |
+bool X509Certificate::WriteCertHandleToPickle(OSCertHandle cert_handle, |
+ Pickle* pickle) { |
+ DERCache der_cache; |
+ if (!GetDERAndCacheIfNeeded(cert_handle, &der_cache)) |
+ return false; |
+ |
+ return pickle->WriteData( |
+ reinterpret_cast<const char*>(der_cache.data), |
+ der_cache.data_length); |
+} |
+ |
} // namespace net |