diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-01 03:15:29 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-01 03:15:29 +0000 |
commit | 5bdf2b4b687c33bb83ed28bab6ed35da20a4d50e (patch) | |
tree | 7666e5405e74387c72715b12cde0292dc7bb0953 /net/base/x509_certificate_win.cc | |
parent | 6e2ab656dcf1ecfbdf52b588ad7f9b212af0551d (diff) | |
download | chromium_src-5bdf2b4b687c33bb83ed28bab6ed35da20a4d50e.zip chromium_src-5bdf2b4b687c33bb83ed28bab6ed35da20a4d50e.tar.gz chromium_src-5bdf2b4b687c33bb83ed28bab6ed35da20a4d50e.tar.bz2 |
Make X509Certificate::GetDEREncoded a static function taking an OSCertHandle
Rather than require an X509Certificate*, which has additional processing
overhead, make X509Certificate::GetDEREncoded a static function which takes an
OSCertHandle. Callers which already have an X509Certificate* can easily use
->os_cert_handle(), while those that have an OSCertHandle, such as by way of
GetIntermediateCertificates(), can use the OSCertHandle directly.
BUG=91464
TEST=none
Review URL: http://codereview.chromium.org/8414047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/x509_certificate_win.cc')
-rw-r--r-- | net/base/x509_certificate_win.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/base/x509_certificate_win.cc b/net/base/x509_certificate_win.cc index efa5e5c..4f27836 100644 --- a/net/base/x509_certificate_win.cc +++ b/net/base/x509_certificate_win.cc @@ -964,12 +964,13 @@ int X509Certificate::VerifyInternal(const std::string& hostname, return OK; } -bool X509Certificate::GetDEREncoded(std::string* encoded) { - if (!cert_handle_->pbCertEncoded || !cert_handle_->cbCertEncoded) +// static +bool X509Certificate::GetDEREncoded(X509Certificate::OSCertHandle cert_handle, + std::string* encoded) { + if (!cert_handle->pbCertEncoded || !cert_handle->cbCertEncoded) return false; - encoded->clear(); - encoded->append(reinterpret_cast<char*>(cert_handle_->pbCertEncoded), - cert_handle_->cbCertEncoded); + encoded->assign(reinterpret_cast<char*>(cert_handle->pbCertEncoded), + cert_handle->cbCertEncoded); return true; } |