xref: /aosp_15_r20/external/cronet/net/cert/ct_sct_to_string.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2016 The Chromium Authors
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_CT_SCT_TO_STRING_H_
6 #define NET_CERT_CT_SCT_TO_STRING_H_
7 
8 #include <string>
9 
10 #include "net/base/net_export.h"
11 #include "net/cert/sct_status_flags.h"
12 #include "net/cert/signed_certificate_timestamp.h"
13 
14 // Functions for converting non-string attributes of
15 // net::ct::SignedCertificateTimestamp and net::ct::SCTVerifyStatus values to
16 // strings.
17 namespace net::ct {
18 
19 // Returns a textual representation of |hash_algorithm|.
20 NET_EXPORT const std::string HashAlgorithmToString(
21     DigitallySigned::HashAlgorithm hashAlgorithm);
22 
23 // Returns a textual representation of |origin|.
24 NET_EXPORT const std::string OriginToString(
25     SignedCertificateTimestamp::Origin origin);
26 
27 // Returns a textual representation of |signatureAlgorithm|.
28 NET_EXPORT const std::string SignatureAlgorithmToString(
29     DigitallySigned::SignatureAlgorithm signatureAlgorithm);
30 
31 // Returns a textual representation of |status|.
32 NET_EXPORT const std::string StatusToString(SCTVerifyStatus status);
33 
34 }  // namespace net::ct
35 
36 #endif  // NET_CERT_CT_SCT_TO_STRING_H_
37