0

I am using the OpenSSL .NET project (https://github.com/openssl-net/openssl-net). In C++ code, I have read the private key from a .pkcs8 file (30 82 02 4b 02 01 20 30 81 ...) to a EVP_PKEY struct like this:

FILE* pFile = NULL;
pFile = fopen("myfile.pkcs8", "rb");
if (pFile)
{
  EVP_PKEY* m_pEVP_PKEY;
  m_pEVP_PKEY = d2i_PrivateKey_fp(pFile, NULL);
}

But I can't seem to find an equivalent to d2i_PrivateKey_fp in the .NET project. How would I read this private key to a EVP_PKEY struct? Thanks!

tzippy
  • 6,458
  • 30
  • 82
  • 151
  • It doesn't look like that library has ported that API, yet. The project also doesn't look like it currently active. – vcsjones Apr 18 '17 at 14:58
  • Thx for the info. Is it possible to use other functions that have already been ported in the project to make this work? – tzippy Apr 18 '17 at 15:00

0 Answers0