add capability to construct EVPPKey from ECKey and RSAKey; RSA EVPPKey tests, RSA KeyPairImpl type bugfix

This commit is contained in:
Alex Fabijanic
2017-09-18 14:49:54 -05:00
parent b90ee449a2
commit dbd82953cb
9 changed files with 157 additions and 9 deletions

View File

@@ -14,6 +14,8 @@
#include "Poco/Crypto/EVPPKey.h"
#include "Poco/Crypto/ECKey.h"
#include "Poco/Crypto/RSAKey.h"
#include "Poco/NumberFormatter.h"
@@ -131,4 +133,19 @@ err:
}
void EVPPKey::setKey(ECKey* pKey)
{
poco_check_ptr(pKey);
poco_check_ptr(pKey->impl());
setKey(pKey->impl()->getECKey());
}
void EVPPKey::setKey(RSAKey* pKey)
{
poco_check_ptr(pKey);
poco_check_ptr(pKey->impl());
setKey(pKey->impl()->getRSA());
}
} } // namespace Poco::Crypto