BCryptImportKeyPair returns STATUS_INVALID_PARAMETER when i try to import public key
问题 I followed this example. I am trying to add the public key which i got from the server into the key Pair and I am getting STATUS_INVALID_PARAMETER. BCRYPT_DH_KEY_BLOB header; header.dwMagic = BCRYPT_DH_PUBLIC_MAGIC; header.cbKey = (ULONG)(pub_key.size()); cout << "header contents " << header.dwMagic << " : " << header.cbKey << endl; memcpy(&pubKeyBlobFromServer[0], &header, sizeof(BCRYPT_DH_KEY_BLOB)); // copy Public key cout << "size of pub_key " << pub_key.size() << endl; cout << "size of