OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_CERT_X509_UTIL_NSS_H_ | 5 #ifndef NET_CERT_X509_UTIL_NSS_H_ |
6 #define NET_CERT_X509_UTIL_NSS_H_ | 6 #define NET_CERT_X509_UTIL_NSS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 10 matching lines...) Expand all Loading... |
21 typedef struct CERTCertificateStr CERTCertificate; | 21 typedef struct CERTCertificateStr CERTCertificate; |
22 typedef struct CERTNameStr CERTName; | 22 typedef struct CERTNameStr CERTName; |
23 typedef struct PK11SlotInfoStr PK11SlotInfo; | 23 typedef struct PK11SlotInfoStr PK11SlotInfo; |
24 typedef struct PLArenaPool PLArenaPool; | 24 typedef struct PLArenaPool PLArenaPool; |
25 typedef struct SECItemStr SECItem; | 25 typedef struct SECItemStr SECItem; |
26 | 26 |
27 namespace net { | 27 namespace net { |
28 | 28 |
29 namespace x509_util { | 29 namespace x509_util { |
30 | 30 |
31 #if defined(USE_NSS_CERTS) || defined(OS_IOS) | 31 #if defined(USE_NSS_VERIFIER) |
32 // Parses the Principal attribute from |name| and outputs the result in | 32 // Parses the Principal attribute from |name| and outputs the result in |
33 // |principal|. | 33 // |principal|. |
34 void ParsePrincipal(CERTName* name, | 34 void ParsePrincipal(CERTName* name, |
35 CertPrincipal* principal); | 35 CertPrincipal* principal); |
36 | 36 |
37 // Parses the date from |der_date| and outputs the result in |result|. | 37 // Parses the date from |der_date| and outputs the result in |result|. |
38 void ParseDate(const SECItem* der_date, base::Time* result); | 38 void ParseDate(const SECItem* der_date, base::Time* result); |
39 | 39 |
40 // Parses the serial number from |certificate|. | 40 // Parses the serial number from |certificate|. |
41 std::string ParseSerialNumber(const CERTCertificate* certificate); | 41 std::string ParseSerialNumber(const CERTCertificate* certificate); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // Generates a unique nickname for |slot|, returning |nickname| if it is | 120 // Generates a unique nickname for |slot|, returning |nickname| if it is |
121 // already unique. | 121 // already unique. |
122 // | 122 // |
123 // Note: The nickname returned will NOT include the token name, thus the | 123 // Note: The nickname returned will NOT include the token name, thus the |
124 // token name must be prepended if calling an NSS function that expects | 124 // token name must be prepended if calling an NSS function that expects |
125 // <token>:<nickname>. | 125 // <token>:<nickname>. |
126 // TODO(gspencer): Internationalize this: it's wrong to hard-code English. | 126 // TODO(gspencer): Internationalize this: it's wrong to hard-code English. |
127 std::string GetUniqueNicknameForSlot(const std::string& nickname, | 127 std::string GetUniqueNicknameForSlot(const std::string& nickname, |
128 const SECItem* subject, | 128 const SECItem* subject, |
129 PK11SlotInfo* slot); | 129 PK11SlotInfo* slot); |
130 #endif // defined(USE_NSS_CERTS) || defined(OS_IOS) | 130 #endif // defined(USE_NSS_VERIFIER) |
131 | 131 |
132 } // namespace x509_util | 132 } // namespace x509_util |
133 | 133 |
134 } // namespace net | 134 } // namespace net |
135 | 135 |
136 #endif // NET_CERT_X509_UTIL_NSS_H_ | 136 #endif // NET_CERT_X509_UTIL_NSS_H_ |
OLD | NEW |