Skip to content
Snippets Groups Projects
Commit 56cc0df9 authored by Klaus Fischer's avatar Klaus Fischer
Browse files

Checking the certificate creation

parent fb886082
No related branches found
No related tags found
1 merge request!3Feature/440 mvp net sdk part 1
...@@ -61,6 +61,12 @@ public class SenderEncryptionWithCertificateTest { ...@@ -61,6 +61,12 @@ public class SenderEncryptionWithCertificateTest {
var req = new CertificateRequest("cn=foobar", ECDsa.Create(), HashAlgorithmName.SHA256); var req = new CertificateRequest("cn=foobar", ECDsa.Create(), HashAlgorithmName.SHA256);
var cert = req.CreateSelfSigned(DateTimeOffset.Now, DateTimeOffset.Now.AddYears(5)); var cert = req.CreateSelfSigned(DateTimeOffset.Now, DateTimeOffset.Now.AddYears(5));
if (cert.GetRSAPublicKey() == null)
throw new Exception("Certificate does not contain a public key");
if (cert.GetRSAPrivateKey() == null)
throw new Exception("Certificate does not contain a private key");
// Export the certificate to a PEM file, just for // Export the certificate to a PEM file, just for
// additional extern testing // additional extern testing
if (exportPath != null) { if (exportPath != null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment