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

Unified Diff: webrtc/base/sslidentity.h

Issue 1189583002: Support generation of EC keys using P256 curve and support ECDSA certs. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: generalize ssl testing code, misc fixes Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/base/sslidentity.h
diff --git a/webrtc/base/sslidentity.h b/webrtc/base/sslidentity.h
index 320fe53d0f5ad01fee6790c469d7ab0276053c4d..3c9ca122fcbaf5c17c338c91786b58803609b79a 100644
--- a/webrtc/base/sslidentity.h
+++ b/webrtc/base/sslidentity.h
@@ -107,6 +107,8 @@ class SSLCertChain {
DISALLOW_COPY_AND_ASSIGN(SSLCertChain);
};
+enum KeyType { KT_RSA, KT_ECDSA, KT_DEFAULT = KT_RSA };
+
// Parameters for generating an identity for testing. If common_name is
// non-empty, it will be used for the certificate's subject and issuer name,
// otherwise a random string will be used. |not_before| and |not_after| are
@@ -115,6 +117,7 @@ struct SSLIdentityParams {
std::string common_name;
int not_before; // in seconds.
int not_after; // in seconds.
+ KeyType key_type;
};
// Our identity in an SSL negotiation: a keypair and certificate (both
@@ -127,7 +130,8 @@ class SSLIdentity {
// subject and issuer name, otherwise a random string will be used.
// Returns NULL on failure.
// Caller is responsible for freeing the returned object.
- static SSLIdentity* Generate(const std::string& common_name);
+ static SSLIdentity* Generate(const std::string& common_name,
+ KeyType key_type);
// Generates an identity with the specified validity period.
static SSLIdentity* GenerateForTest(const SSLIdentityParams& params);
@@ -157,6 +161,7 @@ class SSLIdentity {
extern const char kPemTypeCertificate[];
extern const char kPemTypeRsaPrivateKey[];
+extern const char kPemTypeEcPrivateKey[];
} // namespace rtc

Powered by Google App Engine
This is Rietveld 408576698