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

Side by Side Diff: webrtc/base/sslidentity.h

Issue 1898383003: RTCCertificate serialization. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase with master (std::unique_ptr) Created 4 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 | « webrtc/base/rtccertificate_unittests.cc ('k') | webrtc/base/sslidentity.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 virtual ~SSLIdentity() {} 220 virtual ~SSLIdentity() {}
221 221
222 // Returns a new SSLIdentity object instance wrapping the same 222 // Returns a new SSLIdentity object instance wrapping the same
223 // identity information. 223 // identity information.
224 // Caller is responsible for freeing the returned object. 224 // Caller is responsible for freeing the returned object.
225 // TODO(hbos,torbjorng): Rename to a less confusing name. 225 // TODO(hbos,torbjorng): Rename to a less confusing name.
226 virtual SSLIdentity* GetReference() const = 0; 226 virtual SSLIdentity* GetReference() const = 0;
227 227
228 // Returns a temporary reference to the certificate. 228 // Returns a temporary reference to the certificate.
229 virtual const SSLCertificate& certificate() const = 0; 229 virtual const SSLCertificate& certificate() const = 0;
230 virtual std::string PrivateKeyToPEMString() const = 0;
231 virtual std::string PublicKeyToPEMString() const = 0;
230 232
231 // Helpers for parsing converting between PEM and DER format. 233 // Helpers for parsing converting between PEM and DER format.
232 static bool PemToDer(const std::string& pem_type, 234 static bool PemToDer(const std::string& pem_type,
233 const std::string& pem_string, 235 const std::string& pem_string,
234 std::string* der); 236 std::string* der);
235 static std::string DerToPem(const std::string& pem_type, 237 static std::string DerToPem(const std::string& pem_type,
236 const unsigned char* data, 238 const unsigned char* data,
237 size_t length); 239 size_t length);
238 }; 240 };
239 241
242 bool operator==(const SSLIdentity& a, const SSLIdentity& b);
243 bool operator!=(const SSLIdentity& a, const SSLIdentity& b);
244
240 // Convert from ASN1 time as restricted by RFC 5280 to seconds from 1970-01-01 245 // Convert from ASN1 time as restricted by RFC 5280 to seconds from 1970-01-01
241 // 00.00 ("epoch"). If the ASN1 time cannot be read, return -1. The data at 246 // 00.00 ("epoch"). If the ASN1 time cannot be read, return -1. The data at
242 // |s| is not 0-terminated; its char count is defined by |length|. 247 // |s| is not 0-terminated; its char count is defined by |length|.
243 int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format); 248 int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format);
244 249
245 extern const char kPemTypeCertificate[]; 250 extern const char kPemTypeCertificate[];
246 extern const char kPemTypeRsaPrivateKey[]; 251 extern const char kPemTypeRsaPrivateKey[];
247 extern const char kPemTypeEcPrivateKey[]; 252 extern const char kPemTypeEcPrivateKey[];
248 253
249 } // namespace rtc 254 } // namespace rtc
250 255
251 #endif // WEBRTC_BASE_SSLIDENTITY_H_ 256 #endif // WEBRTC_BASE_SSLIDENTITY_H_
OLDNEW
« no previous file with comments | « webrtc/base/rtccertificate_unittests.cc ('k') | webrtc/base/sslidentity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698