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

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

Issue 2886913004: Copy some x509_certificate_model_nss functions to src/chromeos (reland) (Closed)
Patch Set: Rebase 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 "chromeos/chromeos_export.h"
12 #include "net/cert/cert_type.h"
13 #include "net/cert/x509_certificate.h"
14
15 namespace chromeos {
16 namespace certificate {
17
18 // Selected functions from chrome/common/net/x509_certificate_model.cc
19
20 // Decodes the certificate type from |cert|.
21 CHROMEOS_EXPORT net::CertType GetCertType(
22 net::X509Certificate::OSCertHandle cert_handle);
23
24 // Extracts the token name from |cert|->slot if it exists or returns an empty
25 // string.
26 CHROMEOS_EXPORT std::string GetCertTokenName(
27 net::X509Certificate::OSCertHandle cert_handle);
28
29 // Returns the common name for |cert_handle|->issuer or |alternative_text| if
30 // the common name is missing or empty.
31 CHROMEOS_EXPORT std::string GetIssuerCommonName(
32 net::X509Certificate::OSCertHandle cert_handle,
33 const std::string& alternative_text);
34
35 // Returns the common name for |cert_handle|->subject converted to unicode,
36 // or |cert_handle|->nickname if the subject name is unavailable or empty.
37 // NOTE: Unlike x509_certificate_model::GetCertNameOrNickname in src/chrome,
38 // the raw unformated name or nickname will not be included in the returned
39 // value (see GetCertAsciiNameOrNickname instead).
40 CHROMEOS_EXPORT std::string GetCertNameOrNickname(
41 net::X509Certificate::OSCertHandle cert_handle);
42
43 // Returns the unformated ASCII common name for |cert_handle|->subject.
44 CHROMEOS_EXPORT std::string GetCertAsciiNameOrNickname(
45 net::X509Certificate::OSCertHandle cert_handle);
46
47 } // namespace certificate
48 } // namespace chromeos
49
50 #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