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

Unified 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: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/ct_sct_to_string.h ('k') | net/cert/ct_signed_certificate_timestamp_log_param.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/ct_sct_to_string.cc
diff --git a/net/cert/ct_sct_to_string.cc b/net/cert/ct_sct_to_string.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f3912a828623240199ee30e628887d997a746aff
--- /dev/null
+++ b/net/cert/ct_sct_to_string.cc
@@ -0,0 +1,79 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/cert/ct_sct_to_string.h"
+
+namespace net {
+
+namespace ct {
+
+const std::string HashAlgorithmToString(
+ DigitallySigned::HashAlgorithm hashAlgorithm) {
+ switch (hashAlgorithm) {
+ case DigitallySigned::HASH_ALGO_NONE:
+ return "None / invalid";
+ case DigitallySigned::HASH_ALGO_MD5:
+ return "MD5";
+ case DigitallySigned::HASH_ALGO_SHA1:
+ return "SHA-1";
+ case DigitallySigned::HASH_ALGO_SHA224:
+ return "SHA-224";
+ case DigitallySigned::HASH_ALGO_SHA256:
+ return "SHA-256";
+ case DigitallySigned::HASH_ALGO_SHA384:
+ return "SHA-384";
+ case DigitallySigned::HASH_ALGO_SHA512:
+ return "SHA-512";
+ }
+ return "Unknown";
+}
+
+const std::string SignatureAlgorithmToString(
+ DigitallySigned::SignatureAlgorithm signatureAlgorithm) {
+ switch (signatureAlgorithm) {
+ case DigitallySigned::SIG_ALGO_ANONYMOUS:
+ return "Anonymous";
+ case DigitallySigned::SIG_ALGO_RSA:
+ return "RSA";
+ case DigitallySigned::SIG_ALGO_DSA:
+ return "DSA";
+ case DigitallySigned::SIG_ALGO_ECDSA:
+ return "ECDSA";
+ }
+ return "Unknown";
+}
+
+const std::string OriginToString(SignedCertificateTimestamp::Origin origin) {
+ switch (origin) {
+ case SignedCertificateTimestamp::SCT_EMBEDDED:
+ return "Embedded in certificate";
+ case SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION:
+ return "TLS extension";
+ case SignedCertificateTimestamp::SCT_FROM_OCSP_RESPONSE:
+ return "OCSP";
+ case SignedCertificateTimestamp::SCT_ORIGIN_MAX:
+ NOTREACHED();
+ }
+ return "Unknown";
+}
+
+const std::string StatusToString(SCTVerifyStatus status) {
+ switch (status) {
+ case SCT_STATUS_LOG_UNKNOWN:
+ return "From unknown log";
+ case SCT_STATUS_INVALID:
+ return "Invalid";
+ case SCT_STATUS_OK:
+ return "Verified";
+ case SCT_STATUS_NONE:
+ return "None";
+ case SCT_STATUS_MAX:
+ NOTREACHED();
+ }
+ return "Unknown";
+}
+
+} // namespace ct
+
+} // namespace net
« no previous file with comments | « net/cert/ct_sct_to_string.h ('k') | net/cert/ct_signed_certificate_timestamp_log_param.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698