This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/System.Security.Cryptography.Pkcs/tests/EnvelopedCms Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,11 @@ public static void DecodeAlgorithmRc4_40_PlatformNotSupported()
146146 using ( X509Certificate2 cert = Certificates . RSAKeyTransferCapi1 . GetCertificate ( ) )
147147 {
148148 CmsRecipient recipient = new CmsRecipient ( SubjectIdentifierType . IssuerAndSerialNumber , cert ) ;
149- Assert . Throws < PlatformNotSupportedException > ( ( ) => ecms . Encrypt ( recipient ) ) ;
149+
150+ CryptographicException e =
151+ Assert . Throws < CryptographicException > ( ( ) => ecms . Encrypt ( recipient ) ) ;
152+
153+ Assert . Contains ( Oids . Rc4 , e . Message ) ;
150154 }
151155 }
152156
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ public static void TestKeyAgreement_PlatformNotSupported()
2424 using ( X509Certificate2 cert = Certificates . DHKeyAgree1 . GetCertificate ( ) )
2525 {
2626 CmsRecipient cmsRecipient = new CmsRecipient ( cert ) ;
27- Assert . Throws < PlatformNotSupportedException > ( ( ) => ecms . Encrypt ( cmsRecipient ) ) ;
27+
28+ CryptographicException e =
29+ Assert . Throws < CryptographicException > ( ( ) => ecms . Encrypt ( cmsRecipient ) ) ;
30+
31+ Assert . Contains ( cert . GetKeyAlgorithm ( ) , e . Message ) ;
2832 }
2933 }
3034
You can’t perform that action at this time.
0 commit comments