Skip to content

Commit 2ffe5c3

Browse files
committed
Ignore failures load ECDH private keys in CmsSignerTests
1 parent 653ca83 commit 2ffe5c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

UnitTests/Cryptography/CmsSignerTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
// THE SOFTWARE.
2525
//
2626

27+
using System.Security.Cryptography;
2728
using System.Security.Cryptography.X509Certificates;
2829

2930
using Org.BouncyCastle.Pkcs;
@@ -153,6 +154,9 @@ public void TestConstructors ()
153154
try {
154155
var cert = new X509Certificate2 (path, password, X509KeyStorageFlags.Exportable);
155156
signer = new CmsSigner (cert);
157+
} catch (CryptographicException cex) {
158+
if (!path.EndsWith ("\\ec\\smime.pfx", StringComparison.Ordinal) || !cex.Message.Equals ("Keyset does not exist", StringComparison.Ordinal))
159+
Assert.Fail ($".ctor (X509Certificate2): {cex}");
156160
} catch (Exception ex) {
157161
Assert.Fail ($".ctor (X509Certificate2): {ex}");
158162
}

0 commit comments

Comments
 (0)