| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 SSLCertChain::SSLCertChain(const SSLCertificate* cert) { | 147 SSLCertChain::SSLCertChain(const SSLCertificate* cert) { |
| 148 certs_.push_back(cert->GetReference()); | 148 certs_.push_back(cert->GetReference()); |
| 149 } | 149 } |
| 150 | 150 |
| 151 SSLCertChain::~SSLCertChain() { | 151 SSLCertChain::~SSLCertChain() { |
| 152 std::for_each(certs_.begin(), certs_.end(), DeleteCert); | 152 std::for_each(certs_.begin(), certs_.end(), DeleteCert); |
| 153 } | 153 } |
| 154 | 154 |
| 155 #if SSL_USE_OPENSSL | 155 #if SSL_USE_OPENSSL |
| 156 | 156 |
| 157 // static |
| 157 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) { | 158 SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string) { |
| 158 return OpenSSLCertificate::FromPEMString(pem_string); | 159 return OpenSSLCertificate::FromPEMString(pem_string); |
| 159 } | 160 } |
| 160 | 161 |
| 162 // static |
| 161 SSLIdentity* SSLIdentity::Generate(const std::string& common_name, | 163 SSLIdentity* SSLIdentity::Generate(const std::string& common_name, |
| 162 const KeyParams& key_params, | 164 const KeyParams& key_params, |
| 163 time_t certificate_lifetime) { | 165 time_t certificate_lifetime) { |
| 164 return OpenSSLIdentity::Generate(common_name, key_params, | 166 return OpenSSLIdentity::Generate(common_name, key_params, |
| 165 certificate_lifetime); | 167 certificate_lifetime); |
| 166 } | 168 } |
| 167 | 169 |
| 170 // static |
| 171 SSLIdentity* SSLIdentity::Generate(const std::string& common_name, |
| 172 const KeyParams& key_params) { |
| 173 return OpenSSLIdentity::Generate(common_name, key_params, |
| 174 kDefaultCertificateLifetime); |
| 175 } |
| 176 |
| 177 // static |
| 178 SSLIdentity* SSLIdentity::Generate(const std::string& common_name, |
| 179 KeyType key_type) { |
| 180 return OpenSSLIdentity::Generate(common_name, KeyParams(key_type), |
| 181 kDefaultCertificateLifetime); |
| 182 } |
| 183 |
| 168 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params) { | 184 SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params) { |
| 169 return OpenSSLIdentity::GenerateForTest(params); | 185 return OpenSSLIdentity::GenerateForTest(params); |
| 170 } | 186 } |
| 171 | 187 |
| 188 // static |
| 172 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key, | 189 SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key, |
| 173 const std::string& certificate) { | 190 const std::string& certificate) { |
| 174 return OpenSSLIdentity::FromPEMStrings(private_key, certificate); | 191 return OpenSSLIdentity::FromPEMStrings(private_key, certificate); |
| 175 } | 192 } |
| 176 | 193 |
| 177 #else // !SSL_USE_OPENSSL | 194 #else // !SSL_USE_OPENSSL |
| 178 | 195 |
| 179 #error "No SSL implementation" | 196 #error "No SSL implementation" |
| 180 | 197 |
| 181 #endif // SSL_USE_OPENSSL | 198 #endif // SSL_USE_OPENSSL |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 261 |
| 245 if (bytes_left != 1) { | 262 if (bytes_left != 1) { |
| 246 // Now just Z should remain. Its existence was asserted above. | 263 // Now just Z should remain. Its existence was asserted above. |
| 247 return -1; | 264 return -1; |
| 248 } | 265 } |
| 249 | 266 |
| 250 return TmToSeconds(tm); | 267 return TmToSeconds(tm); |
| 251 } | 268 } |
| 252 | 269 |
| 253 } // namespace rtc | 270 } // namespace rtc |
| OLD | NEW |