security: use EVP_DigestSign* routines in SignerFilter
Change-Id: Ib87c4681084bf0389de527450a2248fe2161e6ee
diff --git a/src/security/transform/private-key.cpp b/src/security/transform/private-key.cpp
index 3ec0ff6..8139a0f 100644
--- a/src/security/transform/private-key.cpp
+++ b/src/security/transform/private-key.cpp
@@ -84,6 +84,22 @@
PrivateKey::~PrivateKey() = default;
+KeyType
+PrivateKey::getKeyType() const
+{
+ if (!m_impl->key)
+ return KeyType::NONE;
+
+ switch (detail::getEvpPkeyType(m_impl->key)) {
+ case EVP_PKEY_RSA:
+ return KeyType::RSA;
+ case EVP_PKEY_EC:
+ return KeyType::EC;
+ default:
+ return KeyType::NONE;
+ }
+}
+
void
PrivateKey::loadPkcs1(const uint8_t* buf, size_t size)
{