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

Side by Side Diff: chromeos/network/certificate_helper.h

Issue 2871993005: Copy some x509_certificate_model_nss functions to src/chromeos (Closed)
Patch Set: Handle empty string in Stringize, use OSCertHandle throughout Created 3 years, 7 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
« no previous file with comments | « chromeos/BUILD.gn ('k') | chromeos/network/certificate_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 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 CHROMEOS_NETWORK_CERTIFICATE_HELPER_H_
6 #define CHROMEOS_NETWORK_CERTIFICATE_HELPER_H_
7
8 #include <cert.h>
9 #include <string>
10
11 #include "net/cert/cert_type.h"
12 #include "net/cert/x509_certificate.h"
13
14 namespace chromeos {
15 namespace certificate {
16
17 // Selected functions from chrome/common/net/x509_certificate_model.cc
18
19 // Decodes the certificate type from |cert|.
20 net::CertType GetCertType(net::X509Certificate::OSCertHandle cert_handle);
21
22 // Extracts the token name from |cert|->slot if it exists or returns an empty
23 // string.
24 std::string GetCertTokenName(net::X509Certificate::OSCertHandle cert_handle);
25
26 // Returns the common name for |cert_handle|->issuer or |alternative_text| if
27 // the common name is missing or empty.
28 std::string GetIssuerCommonName(net::X509Certificate::OSCertHandle cert_handle,
29 const std::string& alternative_text);
30
31 // Returns the common name for |cert_handle|->subject converted to unicode,
32 // or |cert_handle|->nickname if the subject name is unavailable or empty.
33 // NOTE: Unlike x509_certificate_model::GetCertNameOrNickname in src/chrome,
34 // the raw unformated name or nickname will not be included in the returned
35 // value (see GetCertAsciiNameOrNickname instead).
36 std::string GetCertNameOrNickname(
37 net::X509Certificate::OSCertHandle cert_handle);
38
39 // Returns the unformated ASCII common name for |cert_handle|->subject.
40 std::string GetCertAsciiNameOrNickname(
41 net::X509Certificate::OSCertHandle cert_handle);
42
43 } // namespace certificate
44 } // namespace chromeos
45
46 #endif // CHROMEOS_NETWORK_CERTIFICATE_HELPER_H_
OLDNEW
« no previous file with comments | « chromeos/BUILD.gn ('k') | chromeos/network/certificate_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698