| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 100 } |
| 101 | 101 |
| 102 // Helper function for deleting a vector of certificates. | 102 // Helper function for deleting a vector of certificates. |
| 103 static void DeleteCert(SSLCertificate* cert) { delete cert; } | 103 static void DeleteCert(SSLCertificate* cert) { delete cert; } |
| 104 | 104 |
| 105 std::vector<SSLCertificate*> certs_; | 105 std::vector<SSLCertificate*> certs_; |
| 106 | 106 |
| 107 RTC_DISALLOW_COPY_AND_ASSIGN(SSLCertChain); | 107 RTC_DISALLOW_COPY_AND_ASSIGN(SSLCertChain); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 // TODO(hbos, torbjorng): Don't change KT_DEFAULT without first | 110 // TODO(hbos,torbjorng): Don't change KT_DEFAULT without first updating |
| 111 // updating PeerConnectionFactory_nativeCreatePeerConnection's certificate | 111 // PeerConnectionFactory_nativeCreatePeerConnection's certificate generation |
| 112 // generation code. | 112 // code. |
| 113 enum KeyType { KT_RSA, KT_ECDSA, KT_LAST, KT_DEFAULT = KT_RSA }; | 113 enum KeyType { KT_RSA, KT_ECDSA, KT_LAST, KT_DEFAULT = KT_RSA }; |
| 114 | 114 |
| 115 // TODO(hbos): Remove once rtc::KeyType (to be modified) and |
| 116 // blink::WebRTCKeyType (to be landed) match. By using this function in Chromium |
| 117 // appropriately we can change KeyType enum -> class without breaking Chromium. |
| 118 KeyType IntKeyTypeFamilyToKeyType(int key_type_family); |
| 119 |
| 115 // Parameters for generating an identity for testing. If common_name is | 120 // Parameters for generating an identity for testing. If common_name is |
| 116 // non-empty, it will be used for the certificate's subject and issuer name, | 121 // non-empty, it will be used for the certificate's subject and issuer name, |
| 117 // otherwise a random string will be used. |not_before| and |not_after| are | 122 // otherwise a random string will be used. |not_before| and |not_after| are |
| 118 // offsets to the current time in number of seconds. | 123 // offsets to the current time in number of seconds. |
| 119 struct SSLIdentityParams { | 124 struct SSLIdentityParams { |
| 120 std::string common_name; | 125 std::string common_name; |
| 121 int not_before; // in seconds. | 126 int not_before; // in seconds. |
| 122 int not_after; // in seconds. | 127 int not_after; // in seconds. |
| 123 KeyType key_type; | 128 KeyType key_type; |
| 124 }; | 129 }; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 size_t length); | 168 size_t length); |
| 164 }; | 169 }; |
| 165 | 170 |
| 166 extern const char kPemTypeCertificate[]; | 171 extern const char kPemTypeCertificate[]; |
| 167 extern const char kPemTypeRsaPrivateKey[]; | 172 extern const char kPemTypeRsaPrivateKey[]; |
| 168 extern const char kPemTypeEcPrivateKey[]; | 173 extern const char kPemTypeEcPrivateKey[]; |
| 169 | 174 |
| 170 } // namespace rtc | 175 } // namespace rtc |
| 171 | 176 |
| 172 #endif // WEBRTC_BASE_SSLIDENTITY_H_ | 177 #endif // WEBRTC_BASE_SSLIDENTITY_H_ |
| OLD | NEW |