diff --git a/webrtc/base/sslidentity.cc b/webrtc/base/sslidentity.cc index 33b7387588..5e565beb8a 100644 --- a/webrtc/base/sslidentity.cc +++ b/webrtc/base/sslidentity.cc @@ -39,6 +39,10 @@ const char kPemTypeCertificate[] = "CERTIFICATE"; const char kPemTypeRsaPrivateKey[] = "RSA PRIVATE KEY"; const char kPemTypeEcPrivateKey[] = "EC PRIVATE KEY"; +KeyType IntKeyTypeFamilyToKeyType(int key_type_family) { + return static_cast(key_type_family); +} + bool SSLIdentity::PemToDer(const std::string& pem_type, const std::string& pem_string, std::string* der) { diff --git a/webrtc/base/sslidentity.h b/webrtc/base/sslidentity.h index acbd94ef7d..3a1bbd0856 100644 --- a/webrtc/base/sslidentity.h +++ b/webrtc/base/sslidentity.h @@ -107,11 +107,16 @@ class SSLCertChain { RTC_DISALLOW_COPY_AND_ASSIGN(SSLCertChain); }; -// TODO(hbos, torbjorng): Don't change KT_DEFAULT without first -// updating PeerConnectionFactory_nativeCreatePeerConnection's certificate -// generation code. +// TODO(hbos,torbjorng): Don't change KT_DEFAULT without first updating +// PeerConnectionFactory_nativeCreatePeerConnection's certificate generation +// code. enum KeyType { KT_RSA, KT_ECDSA, KT_LAST, KT_DEFAULT = KT_RSA }; +// TODO(hbos): Remove once rtc::KeyType (to be modified) and +// blink::WebRTCKeyType (to be landed) match. By using this function in Chromium +// appropriately we can change KeyType enum -> class without breaking Chromium. +KeyType IntKeyTypeFamilyToKeyType(int key_type_family); + // 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