| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 // error is returned. | 282 // error is returned. |
| 283 // | 283 // |
| 284 // |flags| is bitwise OR'd of VerifyFlags. | 284 // |flags| is bitwise OR'd of VerifyFlags. |
| 285 // If VERIFY_REV_CHECKING_ENABLED is set in |flags|, certificate revocation | 285 // If VERIFY_REV_CHECKING_ENABLED is set in |flags|, certificate revocation |
| 286 // checking is performed. If VERIFY_EV_CERT is set in |flags| too, | 286 // checking is performed. If VERIFY_EV_CERT is set in |flags| too, |
| 287 // EV certificate verification is performed. | 287 // EV certificate verification is performed. |
| 288 int Verify(const std::string& hostname, | 288 int Verify(const std::string& hostname, |
| 289 int flags, | 289 int flags, |
| 290 CertVerifyResult* verify_result) const; | 290 CertVerifyResult* verify_result) const; |
| 291 | 291 |
| 292 // This method returns the DER encoded certificate. |
| 293 // If the return value is true then the DER encoded certificate is available. |
| 294 // The content of the DER encoded certificate is written to |encoded|. |
| 295 bool GetDEREncoded(std::string* encoded); |
| 296 |
| 292 OSCertHandle os_cert_handle() const { return cert_handle_; } | 297 OSCertHandle os_cert_handle() const { return cert_handle_; } |
| 293 | 298 |
| 294 // Returns true if two OSCertHandles refer to identical certificates. | 299 // Returns true if two OSCertHandles refer to identical certificates. |
| 295 static bool IsSameOSCert(OSCertHandle a, OSCertHandle b); | 300 static bool IsSameOSCert(OSCertHandle a, OSCertHandle b); |
| 296 | 301 |
| 297 // Creates an OS certificate handle from the BER-encoded representation. | 302 // Creates an OS certificate handle from the BER-encoded representation. |
| 298 // Returns NULL on failure. | 303 // Returns NULL on failure. |
| 299 static OSCertHandle CreateOSCertHandleFromBytes(const char* data, | 304 static OSCertHandle CreateOSCertHandleFromBytes(const char* data, |
| 300 int length); | 305 int length); |
| 301 | 306 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 377 |
| 373 // Where the certificate comes from. | 378 // Where the certificate comes from. |
| 374 Source source_; | 379 Source source_; |
| 375 | 380 |
| 376 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 381 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
| 377 }; | 382 }; |
| 378 | 383 |
| 379 } // namespace net | 384 } // namespace net |
| 380 | 385 |
| 381 #endif // NET_BASE_X509_CERTIFICATE_H_ | 386 #endif // NET_BASE_X509_CERTIFICATE_H_ |
| OLD | NEW |