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

Side by Side Diff: net/der/input.h

Issue 1125333005: RFC 2459 name comparison. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_DER_INPUT_H_ 5 #ifndef NET_DER_INPUT_H_
6 #define NET_DER_INPUT_H_ 6 #define NET_DER_INPUT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 // Return true if the Input's data and |other|'s data are byte-wise equal. 55 // Return true if the Input's data and |other|'s data are byte-wise equal.
56 bool Equals(const Input& other) const; 56 bool Equals(const Input& other) const;
57 57
58 // Returns a pointer to the Input's data. This method is marked as "unsafe" 58 // Returns a pointer to the Input's data. This method is marked as "unsafe"
59 // because access to the Input's data should be done through ByteReader 59 // because access to the Input's data should be done through ByteReader
60 // instead. This method should only be used where using a ByteReader truly 60 // instead. This method should only be used where using a ByteReader truly
61 // is not an option. 61 // is not an option.
62 const uint8_t* UnsafeData() const { return data_; } 62 const uint8_t* UnsafeData() const { return data_; }
63 63
64 // Returns a copy of the data represented by this object as a std::string.
65 std::string AsString() const;
66
64 private: 67 private:
65 const uint8_t* data_; 68 const uint8_t* data_;
66 size_t len_; 69 size_t len_;
67 }; 70 };
68 71
69 // The BitString class is a helper for representing a valid parsed BIT STRING. 72 // The BitString class is a helper for representing a valid parsed BIT STRING.
70 // 73 //
71 // * The bits are ordered within each octet of bytes() from most to least 74 // * The bits are ordered within each octet of bytes() from most to least
72 // significant, as in the DER encoding. 75 // significant, as in the DER encoding.
73 // 76 //
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 explicit Mark(const uint8_t* ptr); 176 explicit Mark(const uint8_t* ptr);
174 Mark(); 177 Mark();
175 const uint8_t* ptr_; 178 const uint8_t* ptr_;
176 }; 179 };
177 180
178 } // namespace der 181 } // namespace der
179 182
180 } // namespace net 183 } // namespace net
181 184
182 #endif // NET_DER_INPUT_H_ 185 #endif // NET_DER_INPUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698