security: Add support for OpenSSL 1.1.0 API

Change-Id: I8deb4c5c5cbc1755b492ccd12707d83764a91ad7
Refs: #3757
diff --git a/src/security/transform/public-key.cpp b/src/security/transform/public-key.cpp
index a0116e9..3232e5e 100644
--- a/src/security/transform/public-key.cpp
+++ b/src/security/transform/public-key.cpp
@@ -67,7 +67,11 @@
 {
   ENSURE_PUBLIC_KEY_LOADED(m_impl->key);
 
+#if OPENSSL_VERSION_NUMBER < 0x1010000fL
   switch (EVP_PKEY_type(m_impl->key->type)) {
+#else
+  switch (EVP_PKEY_base_id(m_impl->key)) {
+#endif // OPENSSL_VERSION_NUMBER < 0x1010000fL
   case EVP_PKEY_RSA:
     return KeyType::RSA;
   case EVP_PKEY_EC:
@@ -137,7 +141,11 @@
 {
   ENSURE_PUBLIC_KEY_LOADED(m_impl->key);
 
+#if OPENSSL_VERSION_NUMBER < 0x1010000fL
   switch (EVP_PKEY_type(m_impl->key->type)) {
+#else
+  switch (EVP_PKEY_base_id(m_impl->key)) {
+#endif // OPENSSL_VERSION_NUMBER < 0x1010000fL
   case EVP_PKEY_RSA:
     return rsaEncrypt(plainText, plainLen);
   default: