| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CERT_INTERNAL_SIGNATURE_POLICY_H_ | 5 #ifndef NET_CERT_INTERNAL_SIGNATURE_POLICY_H_ |
| 6 #define NET_CERT_INTERNAL_SIGNATURE_POLICY_H_ | 6 #define NET_CERT_INTERNAL_SIGNATURE_POLICY_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
| 12 #include "net/cert/internal/cert_errors.h" |
| 12 #include "net/cert/internal/signature_algorithm.h" | 13 #include "net/cert/internal/signature_algorithm.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 | 16 |
| 16 class CertErrors; | 17 class CertErrors; |
| 17 class SignatureAlgorithm; | 18 class SignatureAlgorithm; |
| 18 | 19 |
| 19 // SignaturePolicy is an interface (and base implementation) for applying | 20 // SignaturePolicy is an interface (and base implementation) for applying |
| 20 // policies when verifying signed data. It lets callers override which | 21 // policies when verifying signed data. It lets callers override which |
| 21 // algorithms, named curves, and key sizes to allow. | 22 // algorithms, named curves, and key sizes to allow. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 public: | 55 public: |
| 55 explicit SimpleSignaturePolicy(size_t min_rsa_modulus_length_bits); | 56 explicit SimpleSignaturePolicy(size_t min_rsa_modulus_length_bits); |
| 56 | 57 |
| 57 bool IsAcceptableModulusLengthForRsa(size_t modulus_length_bits, | 58 bool IsAcceptableModulusLengthForRsa(size_t modulus_length_bits, |
| 58 CertErrors* errors) const override; | 59 CertErrors* errors) const override; |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 const size_t min_rsa_modulus_length_bits_; | 62 const size_t min_rsa_modulus_length_bits_; |
| 62 }; | 63 }; |
| 63 | 64 |
| 65 // TODO(crbug.com/634443): Move exported errors to a central location? |
| 66 extern CertErrorId kRsaModulusTooSmall; |
| 67 |
| 64 } // namespace net | 68 } // namespace net |
| 65 | 69 |
| 66 #endif // NET_CERT_INTERNAL_SIGNATURE_POLICY_H_ | 70 #endif // NET_CERT_INTERNAL_SIGNATURE_POLICY_H_ |
| OLD | NEW |