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_SIGNATURE_ALGORITHM_H_ | |
6 #define NET_CERT_INTERNAL_SIGNATURE_ALGORITHM_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 } | |
16 | |
17 enum class SignatureAlgorithmId { | |
18 RsaPkcs1_5, | |
19 Ecdsa, | |
20 }; | |
21 | |
22 enum class DigestAlgorithmId { | |
23 Sha1, | |
24 Sha256, | |
25 Sha384, | |
26 Sha512, | |
27 }; | |
28 | |
29 // SignatureAlgorithm describes a signature algorithm and its parameters. This | |
30 // corresponds to "AlgorithmIdentifier" from RFC 5280. | |
31 struct NET_EXPORT SignatureAlgorithm { | |
32 // Assigns the SignatureAlgorithm by parsing a DER-encoded | |
33 // "AlgorithmIdentifier" (RFC 5280). | |
34 // | |
35 // Returns true on success. | |
36 WARN_UNUSED_RESULT bool AssignFromDer(const der::Input& signature_algorithm); | |
Ryan Sleevi
2015/06/29 14:45:24
WARN_UNUSED_RESULT historically goes on the end of
| |
37 | |
38 // Returns true if |*this| is equivalent to |other|. | |
39 WARN_UNUSED_RESULT bool Equals(const SignatureAlgorithm& other) const; | |
Ryan Sleevi
2015/06/29 14:45:24
Ditto
| |
40 | |
41 SignatureAlgorithmId algorithm; | |
42 DigestAlgorithmId digest; | |
43 | |
44 // TODO(eroman): Add support for RSASSA-PSS. | |
45 }; | |
46 | |
47 } // namespace net | |
48 | |
49 #endif // NET_CERT_INTERNAL_SIGNATURE_ALGORITHM_H_ | |
OLD | NEW |