Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_CERT_INTERNAL_VERIFY_SIGNED_DATA_H_ | |
| 6 #define NET_CERT_INTERNAL_VERIFY_SIGNED_DATA_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "net/base/net_export.h" | |
| 10 | |
| 11 namespace net { | |
| 12 | |
| 13 namespace der { | |
| 14 class Input; | |
| 15 } | |
|
Ryan Sleevi
2015/07/07 14:07:31
nit: } // namespace der
eroman
2015/07/07 18:07:00
Done.
| |
| 16 | |
| 17 class SignatureAlgorithm; | |
| 18 | |
| 19 // Verifies that |signature_value| is a valid signature of |signed_data| using | |
| 20 // the algorithm |signature_algorithm| and the public key |public_key|. | |
| 21 // | |
| 22 // |signature_algorithm| - The parsed AlgorithmIdentifier | |
| 23 // |signed_data| - The blob of data to verify | |
| 24 // |signature_value| - The bytes for the signature's value, to be interpreted | |
| 25 // according to the signature algorithm. | |
| 26 // IMPORTANT: In RFC 5280, signatureValue is a BIT STRING. The expected | |
| 27 // input to this function is the byte contents of that bit string, and | |
| 28 // not the BIT STRING's DER itself. | |
| 29 // |public_key| - A DER encoded SubjectPublicKeyInfo. | |
|
Ryan Sleevi
2015/07/07 14:07:31
nit: DER-encoded
eroman
2015/07/07 18:07:00
Done.
| |
| 30 // | |
| 31 // Returns true if verification was successful. | |
| 32 NET_EXPORT bool VerifySignedData(const SignatureAlgorithm& signature_algorithm, | |
| 33 const der::Input& signed_data, | |
| 34 const der::Input& signature_value, | |
| 35 const der::Input& public_key) | |
| 36 WARN_UNUSED_RESULT; | |
| 37 | |
| 38 } // namespace net | |
| 39 | |
| 40 #endif // NET_CERT_INTERNAL_VERIFY_SIGNED_DATA_H_ | |
| OLD | NEW |