| 512 | |
| 513 | template<typename error_category = error::rsa_error> |
| 514 | std::string write_bio_to_string(std::unique_ptr<BIO, decltype(&BIO_free_all)>& bio_out, std::error_code& ec) { |
| 515 | char* ptr = nullptr; |
| 516 | auto len = BIO_get_mem_data(bio_out.get(), &ptr); |
| 517 | if (len <= 0 || ptr == nullptr) { |
| 518 | ec = error_category::convert_to_pem_failed; |
| 519 | return {}; |
| 520 | } |
| 521 | return {ptr, static_cast<size_t>(len)}; |
| 522 | } |
| 523 | |
| 524 | inline std::unique_ptr<EVP_MD_CTX, void (*)(EVP_MD_CTX*)> make_evp_md_ctx() { |
| 525 | return |
no test coverage detected