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

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: explicitly enable ECDSA for NSS; tolerate ECDSA and RSA certs in unittest 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..78f846b53e3bc7a304640c3cc892800f1acbf512 100644
--- a/webrtc/base/sslidentity.h
+++ b/webrtc/base/sslidentity.h
@@ -117,6 +117,8 @@ struct SSLIdentityParams {
int not_after; // in seconds.
};
+enum KeyType { KT_RSA, KT_ECDSA, KT_DEFAULT = KT_RSA };
+
// Our identity in an SSL negotiation: a keypair and certificate (both
// with the same public key).
// This too is pretty much immutable once created.
@@ -127,10 +129,12 @@ 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);
+ static SSLIdentity* GenerateForTest(const SSLIdentityParams& params,
+ KeyType key_type);
// Construct an identity from a private key and a certificate.
static SSLIdentity* FromPEMStrings(const std::string& private_key,

Powered by Google App Engine
This is Rietveld 408576698