summaryrefslogtreecommitdiffstats
path: root/net/base/x509_certificate.h
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 03:49:49 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 03:49:49 +0000
commit931945aa9d1a72f61eb37d3f75eb13a542d4fc2e (patch)
treef0ff0f2bb66f1dadff926ae7bb3dd270692ae146 /net/base/x509_certificate.h
parentc5addfbb9cb0518d8346cc9b827c2a5e8c32957d (diff)
downloadchromium_src-931945aa9d1a72f61eb37d3f75eb13a542d4fc2e.zip
chromium_src-931945aa9d1a72f61eb37d3f75eb13a542d4fc2e.tar.gz
chromium_src-931945aa9d1a72f61eb37d3f75eb13a542d4fc2e.tar.bz2
Reverting 8864.
Revert r8864. It broke the build url_request_intercept_job.cc. Review URL: http://codereview.chromium.org/19462 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/x509_certificate.h')
-rw-r--r--net/base/x509_certificate.h41
1 files changed, 4 insertions, 37 deletions
diff --git a/net/base/x509_certificate.h b/net/base/x509_certificate.h
index 9127cc6..4e41570 100644
--- a/net/base/x509_certificate.h
+++ b/net/base/x509_certificate.h
@@ -13,7 +13,6 @@
#include "base/ref_counted.h"
#include "base/singleton.h"
#include "base/time.h"
-#include "testing/gtest/include/gtest/gtest_prod.h"
#if defined(OS_WIN)
#include <windows.h>
@@ -113,25 +112,10 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> {
std::set<Fingerprint, FingerprintLessThan> denied_;
};
- // Where the certificate comes from. The enumeration constants are
- // listed in increasing order of preference.
- enum Source {
- SOURCE_UNUSED = 0, // The source_ member is not used.
- SOURCE_LONE_CERT_IMPORT = 1, // From importing a certificate without
- // its intermediate CA certificates.
- SOURCE_FROM_NETWORK = 2, // From the network.
- };
-
// Create an X509Certificate from a handle to the certificate object
// in the underlying crypto library. This is a transfer of ownership;
// X509Certificate will properly dispose of |cert_handle| for you.
- // |source| specifies where |cert_handle| comes from. Given two
- // certificate handles for the same certificate, our certificate cache
- // prefers the handle from the network because our HTTP cache isn't
- // caching the corresponding intermediate CA certificates yet
- // (http://crbug.com/7065).
- static X509Certificate* CreateFromHandle(OSCertHandle cert_handle,
- Source source);
+ static X509Certificate* CreateFromHandle(OSCertHandle cert_handle);
// Create an X509Certificate from the BER-encoded representation.
// Returns NULL on failure.
@@ -146,7 +130,7 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> {
// Creates a X509Certificate from the ground up. Used by tests that simulate
// SSL connections.
- X509Certificate(const std::string& subject, const std::string& issuer,
+ X509Certificate(std::string subject, std::string issuer,
base::Time start_date, base::Time expiration_date);
// Appends a representation of this object to the given pickle.
@@ -188,9 +172,6 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> {
OSCertHandle os_cert_handle() const { return cert_handle_; }
private:
- friend class base::RefCountedThreadSafe<X509Certificate>;
- FRIEND_TEST(X509CertificateTest, Cache);
-
// A cache of X509Certificate objects.
class Cache {
public:
@@ -219,25 +200,14 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> {
// Construct an X509Certificate from a handle to the certificate object
// in the underlying crypto library.
- X509Certificate(OSCertHandle cert_handle, Source source);
+ explicit X509Certificate(OSCertHandle cert_handle);
+ friend class base::RefCountedThreadSafe<X509Certificate>;
~X509Certificate();
// Common object initialization code. Called by the constructors only.
void Initialize();
- // Creates an OS certificate handle from the BER-encoded representation.
- // Returns NULL on failure.
- static OSCertHandle CreateOSCertHandleFromBytes(const char* data,
- int length);
-
- // Frees an OS certificate handle.
- static void FreeOSCertHandle(OSCertHandle cert_handle);
-
- // Calculates the SHA-1 fingerprint of the certificate. Returns an empty
- // (all zero) fingerprint on failure.
- static Fingerprint CalculateFingerprint(OSCertHandle cert_handle);
-
// The subject of the certificate.
Principal subject_;
@@ -256,9 +226,6 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> {
// A handle to the certificate object in the underlying crypto library.
OSCertHandle cert_handle_;
- // Where the certificate comes from.
- Source source_;
-
DISALLOW_COPY_AND_ASSIGN(X509Certificate);
};