[crypto] add function to determine if RSA is in use

This commit is contained in:
akallabeth 2023-02-03 15:49:55 +01:00 committed by akallabeth
parent 00baf58a71
commit 081e187db8
4 changed files with 16 additions and 0 deletions

View File

@ -39,6 +39,8 @@ extern "C"
FREERDP_API void freerdp_certificate_free(rdpCertificate* certificate);
FREERDP_API BOOL freerdp_certificate_is_rsa(const rdpCertificate* certificate);
FREERDP_API char* freerdp_certificate_get_hash(const rdpCertificate* certificate,
const char* hash, size_t* plength);

View File

@ -36,6 +36,8 @@ extern "C"
FREERDP_API rdpPrivateKey* freerdp_key_new_from_pem(const char* pem);
FREERDP_API void freerdp_key_free(rdpPrivateKey* key);
FREERDP_API BOOL freerdp_key_is_rsa(const rdpPrivateKey* key);
#ifdef __cplusplus
}
#endif

View File

@ -1492,3 +1492,9 @@ BYTE* freerdp_certificate_get_der(const rdpCertificate* cert, size_t* pLength)
*pLength = (size_t)rc;
return ptr;
}
BOOL freerdp_certificate_is_rsa(const rdpCertificate* cert)
{
WINPR_ASSERT(cert);
return cert->isRSA;
}

View File

@ -311,3 +311,9 @@ EVP_PKEY* freerdp_key_get_evp_pkey(const rdpPrivateKey* key)
EVP_PKEY_up_ref(evp);
return evp;
}
BOOL freerdp_key_is_rsa(const rdpPrivateKey* key)
{
WINPR_ASSERT(key);
return key->isRSA;
}