0

I have certificate and ECDSA (on p-256) signature. Now i want to verify this signature using provided certificate. I use c++ (on Windows). Managed code (.NET) can't be used. I found that CryptoAPI doesn'r support ECDSA, so i should use CryptoAPI NG (CNG). However i can't find how to import public key from certificate to the CNG.

Can you help with my problem? Thanks

2 Answers2

0

Issue was solved. I use OpenSSL for this purpose.

0

"The CryptImportPublicKeyInfoEx2 function imports a public key into the CNG asymmetric provider..."

My C may be a bit off, but I believe it to be something like

BCRYPT_KEY_HANDLE hKey;
BOOL imported = CryptImportPublicKeyInfoEx2(
    X509_ASN_ENCODING,
    &(pCertContext->pCertInfo->SubjectPublicKeyInfo),
    0,
    NULL,
    &hKey);

if (!imported)
    goto :err;
bartonjs
  • 30,352
  • 2
  • 71
  • 111