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_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 { | |
|
Ryan Sleevi
2015/06/29 16:36:29
DESIGN: It seems weird to have a structure with en
eroman
2015/06/29 17:05:06
I will switch this to a full blown class.
| |
| 32 // Assigns the SignatureAlgorithm by parsing a DER-encoded | |
| 33 // "AlgorithmIdentifier" (RFC 5280). | |
| 34 // | |
| 35 // Returns true on success. | |
| 36 bool AssignFromDer(const der::Input& signature_algorithm) WARN_UNUSED_RESULT; | |
| 37 | |
| 38 // Returns true if |*this| is equivalent to |other|. | |
| 39 bool Equals(const SignatureAlgorithm& other) const WARN_UNUSED_RESULT; | |
| 40 | |
| 41 SignatureAlgorithmId algorithm; | |
| 42 DigestAlgorithmId digest; | |
| 43 | |
| 44 // TODO(eroman): Add support for RSASSA-PSS. | |
|
Ryan Sleevi
2015/06/29 16:36:29
Is the idea being that you'll support RSASSA-PSS v
eroman
2015/06/29 17:05:06
Let me go ahead and add RSASSA-PSS support to this
| |
| 45 }; | |
| 46 | |
| 47 } // namespace net | |
| 48 | |
| 49 #endif // NET_CERT_INTERNAL_SIGNATURE_ALGORITHM_H_ | |
| OLD | NEW |