| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 // Construct an identity from a private key and a certificate. | 139 // Construct an identity from a private key and a certificate. |
| 140 static SSLIdentity* FromPEMStrings(const std::string& private_key, | 140 static SSLIdentity* FromPEMStrings(const std::string& private_key, |
| 141 const std::string& certificate); | 141 const std::string& certificate); |
| 142 | 142 |
| 143 virtual ~SSLIdentity() {} | 143 virtual ~SSLIdentity() {} |
| 144 | 144 |
| 145 // Returns a new SSLIdentity object instance wrapping the same | 145 // Returns a new SSLIdentity object instance wrapping the same |
| 146 // identity information. | 146 // identity information. |
| 147 // Caller is responsible for freeing the returned object. | 147 // Caller is responsible for freeing the returned object. |
| 148 // TODO(hbos,torbjorng): Rename to a less confusing name. |
| 148 virtual SSLIdentity* GetReference() const = 0; | 149 virtual SSLIdentity* GetReference() const = 0; |
| 149 | 150 |
| 150 // Returns a temporary reference to the certificate. | 151 // Returns a temporary reference to the certificate. |
| 151 virtual const SSLCertificate& certificate() const = 0; | 152 virtual const SSLCertificate& certificate() const = 0; |
| 152 | 153 |
| 153 // Helpers for parsing converting between PEM and DER format. | 154 // Helpers for parsing converting between PEM and DER format. |
| 154 static bool PemToDer(const std::string& pem_type, | 155 static bool PemToDer(const std::string& pem_type, |
| 155 const std::string& pem_string, | 156 const std::string& pem_string, |
| 156 std::string* der); | 157 std::string* der); |
| 157 static std::string DerToPem(const std::string& pem_type, | 158 static std::string DerToPem(const std::string& pem_type, |
| 158 const unsigned char* data, | 159 const unsigned char* data, |
| 159 size_t length); | 160 size_t length); |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 extern const char kPemTypeCertificate[]; | 163 extern const char kPemTypeCertificate[]; |
| 163 extern const char kPemTypeRsaPrivateKey[]; | 164 extern const char kPemTypeRsaPrivateKey[]; |
| 164 extern const char kPemTypeEcPrivateKey[]; | 165 extern const char kPemTypeEcPrivateKey[]; |
| 165 | 166 |
| 166 } // namespace rtc | 167 } // namespace rtc |
| 167 | 168 |
| 168 #endif // WEBRTC_BASE_SSLIDENTITY_H_ | 169 #endif // WEBRTC_BASE_SSLIDENTITY_H_ |
| OLD | NEW |