Example:Serach string EVP_PKEY_get_bn_param
Code in text file
static std::vector<uint8_t> get_rsa_modulus(EVP_PKEY &pkey) { std::unique_ptr<RSA, decltype(&RSA_free)> rsa( EVP_PKEY_get1_RSA(&pkey),&RSA_free); const BIGNUM *n; EVP_PKEY_get_bn_param(keyPriv, "n", &n); std::vector<uint8_t> result(BN_num_bytes(n)); BN_bn2bin(n, result.data()); return result;}
So if EVP_PKEY_get_bn_param is found i have to pick 5 line above and below from the file.
So Output will be
std::unique_ptr<RSA, decltype(&RSA_free)> rsa( EVP_PKEY_get1_RSA(&pkey),&RSA_free); const BIGNUM *n; EVP_PKEY_get_bn_param(keyPriv, "n", &n); std::vector<uint8_t> result(BN_num_bytes(n)); BN_bn2bin(n, result.data()); return result;
Need solution in Python. New to python
I was looking for file operations in python but didn;t solution for it.