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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 // Returns true if I already contain all the given intermediate certs. | 250 // Returns true if I already contain all the given intermediate certs. |
| 251 bool HasIntermediateCertificates(const OSCertHandles& certs); | 251 bool HasIntermediateCertificates(const OSCertHandles& certs); |
| 252 | 252 |
| 253 #if defined(OS_MACOSX) | 253 #if defined(OS_MACOSX) |
| 254 // Does this certificate's usage allow SSL client authentication? | 254 // Does this certificate's usage allow SSL client authentication? |
| 255 bool SupportsSSLClientAuth() const; | 255 bool SupportsSSLClientAuth() const; |
| 256 | 256 |
| 257 // Do any of the given issuer names appear in this cert's chain of trust? | 257 // Do any of the given issuer names appear in this cert's chain of trust? |
| 258 bool IsIssuedBy(const std::vector<CertPrincipal>& valid_issuers); | 258 bool IsIssuedBy(const std::vector<CertPrincipal>& valid_issuers); |
| 259 | 259 |
| 260 // Creates a security policy for SSL client certificates. | 260 // Creates a security policy for SSL certificates. If |is_server| is true, |
| 261 static OSStatus CreateSSLClientPolicy(SecPolicyRef* outPolicy); | 261 // the certificate(s) this policy applies to should be valid as an SSL |
| 262 // server; otherwise, they should be valid as an SSL client certificate. | |
| 263 // If |is_server| is true, |hostname| may be optionally supplied to indicate | |
| 264 // the hostname that the policy should validate as the server. If empty, or | |
| 265 // if |is_server| is false, no name validation will occur. | |
| 266 // If a policy is successfully created, it will be stored in |*policy| and | |
| 267 // ownership transferred to the caller. | |
| 268 static OSStatus CreateSSLPolicy(bool is_server, const std::string& hostname, | |
| 269 SecPolicyRef* policy); | |
| 270 | |
| 271 // Creates a security policy for basix X.509 validation. If the policy is | |
|
wtc
2011/06/03 01:58:04
Typo: basix => basic
| |
| 272 // successfully created, it will be stored in |*policy| and ownership | |
| 273 // transferred to the caller. | |
| 274 static OSStatus CreateBasicX509Policy(SecPolicyRef* policy); | |
| 275 | |
| 276 // Creates security policies to control revocation checking (OCSP and CRL). | |
| 277 // If |enable_revocation_checking| is false, the policies returned will be | |
| 278 // explicitly disabled from accessing the network or the cache. This may be | |
| 279 // used to override system settings regarding revocation checking. | |
| 280 // If the policies are successfully created, they will be appended to | |
| 281 // |policies|. | |
|
wtc
2011/06/03 01:58:04
Do we need to mention "and ownership transferred t
Ryan Sleevi
2011/06/21 03:52:25
I don't think so. It should be well understood tha
| |
| 282 static OSStatus CreateRevocationPolicies(bool enable_revocation_checking, | |
| 283 CFMutableArrayRef policies); | |
| 262 | 284 |
| 263 // Adds all available SSL client identity certs to the given vector. | 285 // Adds all available SSL client identity certs to the given vector. |
| 264 // |server_domain| is a hint for which domain the cert is to be sent to | 286 // |server_domain| is a hint for which domain the cert is to be sent to |
| 265 // (a cert previously specified as the default for that domain will be given | 287 // (a cert previously specified as the default for that domain will be given |
| 266 // precedence and returned first in the output vector.) | 288 // precedence and returned first in the output vector.) |
| 267 // If valid_issuers is non-empty, only certs that were transitively issued by | 289 // If valid_issuers is non-empty, only certs that were transitively issued by |
| 268 // one of the given names will be included in the list. | 290 // one of the given names will be included in the list. |
| 269 static bool GetSSLClientCertificates( | 291 static bool GetSSLClientCertificates( |
| 270 const std::string& server_domain, | 292 const std::string& server_domain, |
| 271 const std::vector<CertPrincipal>& valid_issuers, | 293 const std::vector<CertPrincipal>& valid_issuers, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 454 | 476 |
| 455 // Where the certificate comes from. | 477 // Where the certificate comes from. |
| 456 Source source_; | 478 Source source_; |
| 457 | 479 |
| 458 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 480 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
| 459 }; | 481 }; |
| 460 | 482 |
| 461 } // namespace net | 483 } // namespace net |
| 462 | 484 |
| 463 #endif // NET_BASE_X509_CERTIFICATE_H_ | 485 #endif // NET_BASE_X509_CERTIFICATE_H_ |
| OLD | NEW |