private void ProcessPkcs8Response(CngPkcs8.Pkcs8Response response) { // Wrong algorithm? if (response.GetAlgorithmGroup() != BCryptNative.AlgorithmName.RSA) { response.FreeKey(); throw new CryptographicException(SR.Cryptography_NotValidPublicOrPrivateKey); } AcceptImport(response); }
private void ProcessPkcs8Response(CngPkcs8.Pkcs8Response response) { // Wrong algorithm? switch (response.GetAlgorithmGroup()) { // CNG ECDH and ECDSA keys can both do ECDSA. case BCryptNative.AlgorithmName.ECDsa: case BCryptNative.AlgorithmName.ECDH: AcceptImport(response); return; } response.FreeKey(); throw new CryptographicException(SR.Cryptography_NotValidPublicOrPrivateKey); }