Вот мой код.
X509Certificate pXCert = new X509Certificate2(@"keyStore.p12", "password");
RSACryptoServiceProvider csp = (RSACryptoServiceProvider)pXCert.PrivateKey;
string id = CryptoConfig.MapNameToOID("SHA256");
return csp.SignData(File.ReadAllBytes(filePath), id);
На последней строке я получаю исключение:
System.security.cryptography.cryptographicexception "Неверный алгоритм указан".
Что я делаю не так?
Обновление:
ID = 2.16 .840.1.101.3.4.2.1