Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Unified Diff: net/base/x509_certificate_nss.cc

Issue 4645001: Change the HTTP cache to cache the entire certificate chain for SSL sites (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/net/base
Patch Set: Rebase before commit Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/x509_certificate_nss.cc
diff --git a/net/base/x509_certificate_nss.cc b/net/base/x509_certificate_nss.cc
index 56035fa0483474f0d13810b7af97e8f504d5a5de..14004e0fcca1a77376b9b585a83ef94f0e6b8358 100644
--- a/net/base/x509_certificate_nss.cc
+++ b/net/base/x509_certificate_nss.cc
@@ -650,17 +650,6 @@ void X509Certificate::Initialize() {
}
// 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,
@@ -762,11 +751,6 @@ X509Certificate* X509Certificate::CreateSelfSigned(
return x509_cert;
}
-void X509Certificate::Persist(Pickle* pickle) {
- pickle->WriteData(reinterpret_cast<const char*>(cert_handle_->derCert.data),
- cert_handle_->derCert.len);
-}
-
void X509Certificate::GetDNSNames(std::vector<std::string>* dns_names) const {
dns_names->clear();
@@ -1005,4 +989,24 @@ SHA1Fingerprint X509Certificate::CalculateFingerprint(
return sha1;
}
+// 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) {
+ return pickle->WriteData(
+ reinterpret_cast<const char*>(cert_handle->derCert.data),
+ cert_handle->derCert.len);
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698