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

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: changed a dictionary key 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 namespace net {
8
9 namespace ct {
10
11 const std::string HashAlgorithmToString(
12 DigitallySigned::HashAlgorithm hashAlgorithm) {
13 switch (hashAlgorithm) {
14 case DigitallySigned::HASH_ALGO_NONE:
15 return "None / invalid";
16 case DigitallySigned::HASH_ALGO_MD5:
17 return "MD5";
18 case DigitallySigned::HASH_ALGO_SHA1:
19 return "SHA-1";
20 case DigitallySigned::HASH_ALGO_SHA224:
21 return "SHA-224";
22 case DigitallySigned::HASH_ALGO_SHA256:
23 return "SHA-256";
24 case DigitallySigned::HASH_ALGO_SHA384:
25 return "SHA-384";
26 case DigitallySigned::HASH_ALGO_SHA512:
27 return "SHA-512";
28 }
29 return "Unknown";
30 }
31
32 const std::string SignatureAlgorithmToString(
33 DigitallySigned::SignatureAlgorithm signatureAlgorithm) {
34 switch (signatureAlgorithm) {
35 case DigitallySigned::SIG_ALGO_ANONYMOUS:
36 return "Anonymous";
37 case DigitallySigned::SIG_ALGO_RSA:
38 return "RSA";
39 case DigitallySigned::SIG_ALGO_DSA:
40 return "DSA";
41 case DigitallySigned::SIG_ALGO_ECDSA:
42 return "ECDSA";
43 }
44 return "Unknown";
45 }
46
47 const std::string OriginToString(
48 SignedCertificateTimestamp::Origin origin) {
49 switch (origin) {
50 case SignedCertificateTimestamp::SCT_EMBEDDED:
51 return "Embedded in certificate";
52 case SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION:
53 return "TLS extension";
54 case SignedCertificateTimestamp::SCT_FROM_OCSP_RESPONSE:
55 return "OCSP";
56 case SignedCertificateTimestamp::SCT_ORIGIN_MAX:
57 NOTREACHED();
58 }
59 return "Unknown";
60 }
61
62 const std::string StatusToString(SCTVerifyStatus status) {
63 switch (status) {
64 case SCT_STATUS_LOG_UNKNOWN:
65 return "From unknown log";
66 case SCT_STATUS_INVALID:
67 return "Invalid";
68 case SCT_STATUS_OK:
69 return "Verified";
70 case SCT_STATUS_NONE:
71 return "None";
72 case SCT_STATUS_MAX:
73 NOTREACHED();
74 }
75 return "Unknown";
76 }
77
78 } // namespace ct
79
80 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698