Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: net/cert/internal/signature_algorithm.h

Issue 1218753002: Add DER parsing of AlgorithmId for signatures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove clang-format off and just accept its formatting Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW
« no previous file with comments | « no previous file | net/cert/internal/signature_algorithm.cc » ('j') | net/cert/internal/signature_algorithm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698