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

Side by Side Diff: net/base/x509_certificate.h

Issue 8414047: Make X509Certificate::GetDEREncoded a static function taking an OSCertHandle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and tweak comment to wtc's verbiage Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/ssl_config_service.cc ('k') | net/base/x509_certificate_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_X509_CERTIFICATE_H_ 5 #ifndef NET_BASE_X509_CERTIFICATE_H_
6 #define NET_BASE_X509_CERTIFICATE_H_ 6 #define NET_BASE_X509_CERTIFICATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 int flags, 386 int flags,
387 CRLSet* crl_set, 387 CRLSet* crl_set,
388 CertVerifyResult* verify_result) const; 388 CertVerifyResult* verify_result) const;
389 389
390 // Verifies that |hostname| matches this certificate. 390 // Verifies that |hostname| matches this certificate.
391 // Does not verify that the certificate is valid, only that the certificate 391 // Does not verify that the certificate is valid, only that the certificate
392 // matches this host. 392 // matches this host.
393 // Returns true if it matches. 393 // Returns true if it matches.
394 bool VerifyNameMatch(const std::string& hostname) const; 394 bool VerifyNameMatch(const std::string& hostname) const;
395 395
396 // This method returns the DER encoded certificate. 396 // Obtains the DER encoded certificate data for |cert_handle|. On success,
397 // If the return value is true then the DER encoded certificate is available. 397 // returns true and writes the DER encoded certificate to |*der_encoded|.
398 // The content of the DER encoded certificate is written to |encoded|. 398 static bool GetDEREncoded(OSCertHandle cert_handle,
399 bool GetDEREncoded(std::string* encoded); 399 std::string* der_encoded);
400 400
401 // Returns the OSCertHandle of this object. Because of caching, this may 401 // Returns the OSCertHandle of this object. Because of caching, this may
402 // differ from the OSCertHandle originally supplied during initialization. 402 // differ from the OSCertHandle originally supplied during initialization.
403 // Note: On Windows, CryptoAPI may return unexpected results if this handle 403 // Note: On Windows, CryptoAPI may return unexpected results if this handle
404 // is used across multiple threads. For more details, see 404 // is used across multiple threads. For more details, see
405 // CreateOSCertChainForCert(). 405 // CreateOSCertChainForCert().
406 OSCertHandle os_cert_handle() const { return cert_handle_; } 406 OSCertHandle os_cert_handle() const { return cert_handle_; }
407 407
408 // Returns true if two OSCertHandles refer to identical certificates. 408 // Returns true if two OSCertHandles refer to identical certificates.
409 static bool IsSameOSCert(OSCertHandle a, OSCertHandle b); 409 static bool IsSameOSCert(OSCertHandle a, OSCertHandle b);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 // (Marked mutable because it's used in a const method.) 552 // (Marked mutable because it's used in a const method.)
553 mutable base::Lock verification_lock_; 553 mutable base::Lock verification_lock_;
554 #endif 554 #endif
555 555
556 DISALLOW_COPY_AND_ASSIGN(X509Certificate); 556 DISALLOW_COPY_AND_ASSIGN(X509Certificate);
557 }; 557 };
558 558
559 } // namespace net 559 } // namespace net
560 560
561 #endif // NET_BASE_X509_CERTIFICATE_H_ 561 #endif // NET_BASE_X509_CERTIFICATE_H_
OLDNEW
« no previous file with comments | « net/base/ssl_config_service.cc ('k') | net/base/x509_certificate_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698