Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 333 int flags, | 333 int flags, |
| 334 CRLSet* crl_set, | 334 CRLSet* crl_set, |
| 335 CertVerifyResult* verify_result) const; | 335 CertVerifyResult* verify_result) const; |
| 336 | 336 |
| 337 // Verifies that |hostname| matches this certificate. | 337 // Verifies that |hostname| matches this certificate. |
| 338 // Does not verify that the certificate is valid, only that the certificate | 338 // Does not verify that the certificate is valid, only that the certificate |
| 339 // matches this host. | 339 // matches this host. |
| 340 // Returns true if it matches. | 340 // Returns true if it matches. |
| 341 bool VerifyNameMatch(const std::string& hostname) const; | 341 bool VerifyNameMatch(const std::string& hostname) const; |
| 342 | 342 |
| 343 // This method returns the DER encoded certificate. | 343 // This method returns the DER encoded data from an OSCertHandle. |
|
wtc
2011/10/31 19:05:41
The |certificate| used in the original comment is
| |
| 344 // If the return value is true then the DER encoded certificate is available. | 344 // If the return value is true, then the DER encoded certificate is written |
| 345 // The content of the DER encoded certificate is written to |encoded|. | 345 // to |der_encoded|. |
|
wtc
2011/10/31 19:05:41
We should say something like "On success, returns
| |
| 346 bool GetDEREncoded(std::string* encoded); | 346 static bool GetDEREncoded(OSCertHandle cert_handle, |
| 347 std::string* der_encoded); | |
| 347 | 348 |
| 348 OSCertHandle os_cert_handle() const { return cert_handle_; } | 349 OSCertHandle os_cert_handle() const { return cert_handle_; } |
| 349 | 350 |
| 350 // Returns true if two OSCertHandles refer to identical certificates. | 351 // Returns true if two OSCertHandles refer to identical certificates. |
| 351 static bool IsSameOSCert(OSCertHandle a, OSCertHandle b); | 352 static bool IsSameOSCert(OSCertHandle a, OSCertHandle b); |
| 352 | 353 |
| 353 // Creates an OS certificate handle from the BER-encoded representation. | 354 // Creates an OS certificate handle from the BER-encoded representation. |
| 354 // Returns NULL on failure. | 355 // Returns NULL on failure. |
| 355 static OSCertHandle CreateOSCertHandleFromBytes(const char* data, | 356 static OSCertHandle CreateOSCertHandleFromBytes(const char* data, |
| 356 int length); | 357 int length); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 499 // (Marked mutable because it's used in a const method.) | 500 // (Marked mutable because it's used in a const method.) |
| 500 mutable base::Lock verification_lock_; | 501 mutable base::Lock verification_lock_; |
| 501 #endif | 502 #endif |
| 502 | 503 |
| 503 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 504 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
| 504 }; | 505 }; |
| 505 | 506 |
| 506 } // namespace net | 507 } // namespace net |
| 507 | 508 |
| 508 #endif // NET_BASE_X509_CERTIFICATE_H_ | 509 #endif // NET_BASE_X509_CERTIFICATE_H_ |
| OLD | NEW |