#c# #cryptography #pkcs#7
Вопрос:
Я пытаюсь проверить подписи с помощью системы.Безопасность.Криптография.Pkcs со следующим исходным кодом
SignedCms signedData = new SignedCms();
signedData.Decode(Convert.FromBase64String(input));
signedData.CheckSignature(true);
return true;
Я получаю исключение CryptographyException с надписью «неизвестная ошибка» (по-немецки «Unbekannter Fehler» и код -1073700864)
System.Security.Cryptography.CryptographicException
HResult=0xC000A000
Nachricht = Unbekannter Fehler -1073700864.
Quelle = System.Security
Stapelüberwachung:
bei System.Security.Cryptography.Pkcs.SignerInfo.Verify(X509Certificate2Collection extraStore, X509Certificate2 certificate, Boolean verifySignatureOnly)
bei System.Security.Cryptography.Pkcs.SignerInfo.CheckSignature(X509Certificate2Collection extraStore, Boolean verifySignatureOnly)
bei System.Security.Cryptography.Pkcs.SignedCms.CheckSignatures(SignerInfoCollection signers, X509Certificate2Collection extraStore, Boolean verifySignatureOnly)
bei System.Security.Cryptography.Pkcs.SignedCms.CheckSignature(X509Certificate2Collection extraStore, Boolean verifySignatureOnly)
bei System.Security.Cryptography.Pkcs.SignedCms.CheckSignature(Boolean verifySignatureOnly)
bei Ars.Basics.ERezept.EDispensierung.Encryption.PkcsCryptoService.VerifySignature(String input) in C:EntwicklungARSBasicsArs.Basics.ErezeptDevelopmentArs.Basics.Erezept.EDispensierungEncryptionPkcsCryptoService.cs: Zeile21
bei TestConsole.Program.SignatureTest() in C:EntwicklungARSBasicsArs.Basics.ErezeptDevelopmentTestConsoleProgram.cs: Zeile114
bei TestConsole.Program.Main(String[] args) in C:EntwicklungARSBasicsArs.Basics.ErezeptDevelopmentTestConsoleProgram.cs: Zeile99
Кто-нибудь знает, в чем проблема?
Сообщение, по-видимому, правильно расшифровано, потому что в SignedData.ContentInfo.Content я получаю правильный контент.