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

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

Issue 1329493005: Provide RSA2048 as per RFC (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 DISALLOW_COPY_AND_ASSIGN(SSLCertChain); 107 DISALLOW_COPY_AND_ASSIGN(SSLCertChain);
108 }; 108 };
109 109
110 enum KeyType { KT_RSA, KT_ECDSA, KT_LAST, KT_DEFAULT = KT_RSA }; 110 // KT_ECDSA is the NIST P256 curve.
111 // KT_RSA1024 is RSA with 1024-bit modulus (512-bit primes).
112 // KT_RSA2048 is RSA with 2048-bit modulus (1024-bit primes).
113 // KT_RSA is currently an alias for KT_RSA1024. This may change.
114 // KT_DEFAULT is currently an alias for KT_RSA. This is likely to change.
115 // KT_LAST is intended for vector declarations and loops over all key types;
116 // it does not represent any key type in itself.
117 // The WebRTC RFC draft mandates KT_ECDSA and KT_RSA2048.
hbos 2015/09/01 15:35:32 nit: How about having one comment per key type dow
118 enum KeyType {
119 KT_RSA1024,
juberti 2015/09/01 19:36:52 Squashing both key type and key length into a sing
120 KT_ECDSA,
121 KT_RSA2048,
122 KT_RSA = KT_RSA1024,
123 KT_DEFAULT = KT_RSA,
124 KT_LAST
hbos 2015/09/01 15:35:32 KT_LAST should be before any alias/default key typ
125 };
hbos 2015/09/01 15:35:32 Should KT_RSA be a permanent alias for KT_RSA1024
111 126
112 // Parameters for generating an identity for testing. If common_name is 127 // Parameters for generating an identity for testing. If common_name is
113 // non-empty, it will be used for the certificate's subject and issuer name, 128 // non-empty, it will be used for the certificate's subject and issuer name,
114 // otherwise a random string will be used. |not_before| and |not_after| are 129 // otherwise a random string will be used. |not_before| and |not_after| are
115 // offsets to the current time in number of seconds. 130 // offsets to the current time in number of seconds.
116 struct SSLIdentityParams { 131 struct SSLIdentityParams {
117 std::string common_name; 132 std::string common_name;
118 int not_before; // in seconds. 133 int not_before; // in seconds.
119 int not_after; // in seconds. 134 int not_after; // in seconds.
120 KeyType key_type; 135 KeyType key_type;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 size_t length); 175 size_t length);
161 }; 176 };
162 177
163 extern const char kPemTypeCertificate[]; 178 extern const char kPemTypeCertificate[];
164 extern const char kPemTypeRsaPrivateKey[]; 179 extern const char kPemTypeRsaPrivateKey[];
165 extern const char kPemTypeEcPrivateKey[]; 180 extern const char kPemTypeEcPrivateKey[];
166 181
167 } // namespace rtc 182 } // namespace rtc
168 183
169 #endif // WEBRTC_BASE_SSLIDENTITY_H_ 184 #endif // WEBRTC_BASE_SSLIDENTITY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698