Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 virtual ~SSLIdentity() {} | 219 virtual ~SSLIdentity() {} |
| 220 | 220 |
| 221 // Returns a new SSLIdentity object instance wrapping the same | 221 // Returns a new SSLIdentity object instance wrapping the same |
| 222 // identity information. | 222 // identity information. |
| 223 // Caller is responsible for freeing the returned object. | 223 // Caller is responsible for freeing the returned object. |
| 224 // TODO(hbos,torbjorng): Rename to a less confusing name. | 224 // TODO(hbos,torbjorng): Rename to a less confusing name. |
| 225 virtual SSLIdentity* GetReference() const = 0; | 225 virtual SSLIdentity* GetReference() const = 0; |
| 226 | 226 |
| 227 // Returns a temporary reference to the certificate. | 227 // Returns a temporary reference to the certificate. |
| 228 virtual const SSLCertificate& certificate() const = 0; | 228 virtual const SSLCertificate& certificate() const = 0; |
| 229 virtual std::string PrivateKeyToPemString() const = 0; | |
| 229 | 230 |
| 230 // Helpers for parsing converting between PEM and DER format. | 231 // Helpers for parsing converting between PEM and DER format. |
| 231 static bool PemToDer(const std::string& pem_type, | 232 static bool PemToDer(const std::string& pem_type, |
| 232 const std::string& pem_string, | 233 const std::string& pem_string, |
| 233 std::string* der); | 234 std::string* der); |
| 234 static std::string DerToPem(const std::string& pem_type, | 235 static std::string DerToPem(const std::string& pem_type, |
|
nisse-webrtc
2016/04/22 13:44:07
This seems to indicate that DER encoding rules are
hbos
2016/04/25 14:23:23
Acknowledged. Leaving comparisons as-is for now, n
| |
| 235 const unsigned char* data, | 236 const unsigned char* data, |
| 236 size_t length); | 237 size_t length); |
| 237 }; | 238 }; |
| 238 | 239 |
| 240 bool operator==(const SSLIdentity& a, const SSLIdentity& b); | |
| 241 | |
| 239 // Convert from ASN1 time as restricted by RFC 5280 to seconds from 1970-01-01 | 242 // Convert from ASN1 time as restricted by RFC 5280 to seconds from 1970-01-01 |
| 240 // 00.00 ("epoch"). If the ASN1 time cannot be read, return -1. The data at | 243 // 00.00 ("epoch"). If the ASN1 time cannot be read, return -1. The data at |
| 241 // |s| is not 0-terminated; its char count is defined by |length|. | 244 // |s| is not 0-terminated; its char count is defined by |length|. |
| 242 int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format); | 245 int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format); |
| 243 | 246 |
| 244 extern const char kPemTypeCertificate[]; | 247 extern const char kPemTypeCertificate[]; |
| 245 extern const char kPemTypeRsaPrivateKey[]; | 248 extern const char kPemTypeRsaPrivateKey[]; |
| 246 extern const char kPemTypeEcPrivateKey[]; | 249 extern const char kPemTypeEcPrivateKey[]; |
| 247 | 250 |
| 248 } // namespace rtc | 251 } // namespace rtc |
| 249 | 252 |
| 250 #endif // WEBRTC_BASE_SSLIDENTITY_H_ | 253 #endif // WEBRTC_BASE_SSLIDENTITY_H_ |
| OLD | NEW |