| 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_VERIFY_SIGNED_DATA_H_ | 5 #ifndef NET_CERT_INTERNAL_VERIFY_SIGNED_DATA_H_ |
| 6 #define NET_CERT_INTERNAL_VERIFY_SIGNED_DATA_H_ | 6 #define NET_CERT_INTERNAL_VERIFY_SIGNED_DATA_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "net/base/net_export.h" | 9 #include "net/base/net_export.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 namespace der { | 13 namespace der { |
| 14 class Input; | 14 class Input; |
| 15 } // namespace der | 15 } // namespace der |
| 16 | 16 |
| 17 class SignatureAlgorithm; | 17 class SignatureAlgorithm; |
| 18 class SignaturePolicy; |
| 18 | 19 |
| 19 // Verifies that |signature_value| is a valid signature of |signed_data| using | 20 // Verifies that |signature_value| is a valid signature of |signed_data| using |
| 20 // the algorithm |signature_algorithm| and the public key |public_key|. | 21 // the algorithm |signature_algorithm| and the public key |public_key|. |
| 21 // | 22 // |
| 22 // |signature_algorithm| - The parsed AlgorithmIdentifier | 23 // |signature_algorithm| - The parsed AlgorithmIdentifier |
| 23 // |signed_data| - The blob of data to verify | 24 // |signed_data| - The blob of data to verify |
| 24 // |signature_value_bit_string| - The DER-encoded BIT STRING representing the | 25 // |signature_value_bit_string| - The DER-encoded BIT STRING representing the |
| 25 // signature's value (to be interpreted according to the signature | 26 // signature's value (to be interpreted according to the signature |
| 26 // algorithm). | 27 // algorithm). |
| 27 // |public_key| - A DER-encoded SubjectPublicKeyInfo. | 28 // |public_key| - A DER-encoded SubjectPublicKeyInfo. |
| 29 // |policy| - Instance of the policy to use. This will be queried to |
| 30 // determine if: |
| 31 // * The parsed RSA key is an adequate size. |
| 32 // * The parsed EC key is for an allowed curve. |
| 33 // * The signature algorithm and its parameters are acceptable. |
| 28 // | 34 // |
| 29 // Returns true if verification was successful. | 35 // Returns true if verification was successful. |
| 30 NET_EXPORT bool VerifySignedData(const SignatureAlgorithm& signature_algorithm, | 36 NET_EXPORT bool VerifySignedData(const SignatureAlgorithm& signature_algorithm, |
| 31 const der::Input& signed_data, | 37 const der::Input& signed_data, |
| 32 const der::Input& signature_value_bit_string, | 38 const der::Input& signature_value_bit_string, |
| 33 const der::Input& public_key) | 39 const der::Input& public_key, |
| 40 const SignaturePolicy* policy) |
| 34 WARN_UNUSED_RESULT; | 41 WARN_UNUSED_RESULT; |
| 35 | 42 |
| 36 } // namespace net | 43 } // namespace net |
| 37 | 44 |
| 38 #endif // NET_CERT_INTERNAL_VERIFY_SIGNED_DATA_H_ | 45 #endif // NET_CERT_INTERNAL_VERIFY_SIGNED_DATA_H_ |
| OLD | NEW |