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

Side by Side Diff: net/cert/ct_sct_to_string.cc

Issue 1772603002: Addition of Certificate Transparency details to Security panel of DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed NetLog token Created 4 years, 6 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 2016 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 #include "net/cert/ct_sct_to_string.h"
6
7 #include <string>
8
9 namespace net {
10
11 namespace ct {
12
13 const std::string HashAlgorithmToString(
14 net::ct::DigitallySigned::HashAlgorithm hashAlgorithm) {
davidben 2016/06/14 15:47:37 Ditto on net::ct:: prefix
dwaxweiler 2016/06/14 16:57:02 Acknowledged.
15 switch (hashAlgorithm) {
16 case net::ct::DigitallySigned::HASH_ALGO_NONE:
17 return "None / invalid";
18 case net::ct::DigitallySigned::HASH_ALGO_MD5:
19 return "MD5";
20 case net::ct::DigitallySigned::HASH_ALGO_SHA1:
21 return "SHA-1";
22 case net::ct::DigitallySigned::HASH_ALGO_SHA224:
23 return "SHA-224";
24 case net::ct::DigitallySigned::HASH_ALGO_SHA256:
25 return "SHA-256";
26 case net::ct::DigitallySigned::HASH_ALGO_SHA384:
27 return "SHA-384";
28 case net::ct::DigitallySigned::HASH_ALGO_SHA512:
29 return "SHA-512";
30 }
31 return "Unknown";
32 }
33
34 const std::string SignatureAlgorithmToString(
35 net::ct::DigitallySigned::SignatureAlgorithm signatureAlgorithm) {
36 switch (signatureAlgorithm) {
37 case net::ct::DigitallySigned::SIG_ALGO_ANONYMOUS:
38 return "Anonymous";
39 case net::ct::DigitallySigned::SIG_ALGO_RSA:
40 return "RSA";
41 case net::ct::DigitallySigned::SIG_ALGO_DSA:
42 return "DSA";
43 case net::ct::DigitallySigned::SIG_ALGO_ECDSA:
44 return "ECDSA";
45 }
46 return "Unknown";
47 }
48
49 const std::string OriginToString(
50 net::ct::SignedCertificateTimestamp::Origin origin) {
51 switch (origin) {
52 case net::ct::SignedCertificateTimestamp::SCT_EMBEDDED:
53 return "Embedded in certificate";
54 case net::ct::SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION:
55 return "TLS extension";
56 case net::ct::SignedCertificateTimestamp::SCT_FROM_OCSP_RESPONSE:
57 return "OCSP";
58 case net::ct::SignedCertificateTimestamp::SCT_ORIGIN_MAX:
59 NOTREACHED();
60 }
61 return "Unknown";
62 }
63
64 const std::string StatusToString(net::ct::SCTVerifyStatus status) {
65 switch (status) {
66 case net::ct::SCT_STATUS_LOG_UNKNOWN:
67 return "From unknown log";
68 case net::ct::SCT_STATUS_INVALID:
69 return "Invalid";
70 case net::ct::SCT_STATUS_OK:
71 return "Verified";
72 case net::ct::SCT_STATUS_NONE:
73 return "None";
74 case net::ct::SCT_STATUS_MAX:
75 NOTREACHED();
76 }
77 return "Unknown";
78 }
79
80 } // namespace ct
81
82 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698