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

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

Issue 10855168: Rename X509Certificate::VerifyFlags to CertVerifier::VerifyFlags (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One missed mac define Created 8 years, 4 months 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 | « no previous file | net/base/cert_verify_proc.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CERT_VERIFIER_H_ 5 #ifndef NET_BASE_CERT_VERIFIER_H_
6 #define NET_BASE_CERT_VERIFIER_H_ 6 #define NET_BASE_CERT_VERIFIER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 11 matching lines...) Expand all
22 // 22 //
23 // CertVerifiers can handle multiple requests at a time. A simpler alternative 23 // CertVerifiers can handle multiple requests at a time. A simpler alternative
24 // for consumers that only have 1 outstanding request at a time is to create a 24 // for consumers that only have 1 outstanding request at a time is to create a
25 // SingleRequestCertVerifier wrapper around CertVerifier (which will 25 // SingleRequestCertVerifier wrapper around CertVerifier (which will
26 // automatically cancel the single request when it goes out of scope). 26 // automatically cancel the single request when it goes out of scope).
27 class NET_EXPORT CertVerifier { 27 class NET_EXPORT CertVerifier {
28 public: 28 public:
29 // Opaque pointer type used to cancel outstanding requests. 29 // Opaque pointer type used to cancel outstanding requests.
30 typedef void* RequestHandle; 30 typedef void* RequestHandle;
31 31
32 enum VerifyFlags {
33 // If set, enables online revocation checking via CRLs and OCSP for the
34 // certificate chain.
35 VERIFY_REV_CHECKING_ENABLED = 1 << 0,
36
37 // If set, and the certificate being verified may be an EV certificate,
38 // attempt to verify the certificate according to the EV processing
39 // guidelines. In order to successfully verify a certificate as EV,
40 // either an online or offline revocation check must be successfully
41 // completed. To ensure it's possible to complete a revocation check,
42 // callers should also specify either VERIFY_REV_CHECKING_ENABLED or
43 // VERIFY_REV_CHECKING_ENABLED_EV_ONLY (to enable online checks), and
44 // VERIFY_CERT_IO_ENABLED (to enable network fetches for online checks).
45 VERIFY_EV_CERT = 1 << 1,
46
47 // If set, permits NSS to use the network when verifying certificates,
48 // such as to fetch missing intermediates or to check OCSP or CRLs.
49 // TODO(rsleevi): http://crbug.com/143300 - Define this flag for all
50 // verification engines with well-defined semantics, rather than being
51 // NSS only.
52 VERIFY_CERT_IO_ENABLED = 1 << 2,
53
54 // If set, enables online revocation checking via CRLs or OCSP, but only
55 // for certificates which may be EV, and only when VERIFY_EV_CERT is also
56 // set.
57 VERIFY_REV_CHECKING_ENABLED_EV_ONLY = 1 << 3,
58 };
59
32 // When the verifier is destroyed, all certificate verification requests are 60 // When the verifier is destroyed, all certificate verification requests are
33 // canceled, and their completion callbacks will not be called. 61 // canceled, and their completion callbacks will not be called.
34 virtual ~CertVerifier() {} 62 virtual ~CertVerifier() {}
35 63
36 // Verifies the given certificate against the given hostname as an SSL server. 64 // Verifies the given certificate against the given hostname as an SSL server.
37 // Returns OK if successful or an error code upon failure. 65 // Returns OK if successful or an error code upon failure.
38 // 66 //
39 // The |*verify_result| structure, including the |verify_result->cert_status| 67 // The |*verify_result| structure, including the |verify_result->cert_status|
40 // bitmask, is always filled out regardless of the return value. If the 68 // bitmask, is always filled out regardless of the return value. If the
41 // certificate has multiple errors, the corresponding status flags are set in 69 // certificate has multiple errors, the corresponding status flags are set in
42 // |verify_result->cert_status|, and the error code for the most serious 70 // |verify_result->cert_status|, and the error code for the most serious
43 // error is returned. 71 // error is returned.
44 // 72 //
45 // |flags| is bitwise OR'd of X509Certificate::VerifyFlags. 73 // |flags| is bitwise OR'd of VerifyFlags.
46 // If VERIFY_REV_CHECKING_ENABLED is set in |flags|, certificate revocation 74 // If VERIFY_REV_CHECKING_ENABLED is set in |flags|, certificate revocation
47 // checking is performed. 75 // checking is performed.
48 // 76 //
49 // If VERIFY_EV_CERT is set in |flags| too, EV certificate verification is 77 // If VERIFY_EV_CERT is set in |flags| too, EV certificate verification is
50 // performed. If |flags| is VERIFY_EV_CERT (that is, 78 // performed. If |flags| is VERIFY_EV_CERT (that is,
51 // VERIFY_REV_CHECKING_ENABLED is not set), EV certificate verification will 79 // VERIFY_REV_CHECKING_ENABLED is not set), EV certificate verification will
52 // not be performed. 80 // not be performed.
53 // 81 //
54 // |crl_set| points to an optional CRLSet structure which can be used to 82 // |crl_set| points to an optional CRLSet structure which can be used to
55 // avoid revocation checks over the network. 83 // avoid revocation checks over the network.
(...skipping 21 matching lines...) Expand all
77 virtual void CancelRequest(RequestHandle req) = 0; 105 virtual void CancelRequest(RequestHandle req) = 0;
78 106
79 // Creates a CertVerifier implementation that verifies certificates using 107 // Creates a CertVerifier implementation that verifies certificates using
80 // the preferred underlying cryptographic libraries. 108 // the preferred underlying cryptographic libraries.
81 static CertVerifier* CreateDefault(); 109 static CertVerifier* CreateDefault();
82 }; 110 };
83 111
84 } // namespace net 112 } // namespace net
85 113
86 #endif // NET_BASE_CERT_VERIFIER_H_ 114 #endif // NET_BASE_CERT_VERIFIER_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/cert_verify_proc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698