| 71 | } |
| 72 | |
| 73 | inline PKeyAlgorithm getPKeyAlgorithm(const EVP_PKEY* key) noexcept { |
| 74 | auto id = ::EVP_PKEY_base_id(key); |
| 75 | if (id == EVP_PKEY_RSA) |
| 76 | return PKeyAlgorithm::RSA; |
| 77 | else if (id == EVP_PKEY_EC) |
| 78 | return PKeyAlgorithm::EC; |
| 79 | else |
| 80 | return PKeyAlgorithm::UNSUPPORTED; |
| 81 | } |
| 82 | |
| 83 | } // anonymous namespace |
| 84 |