Porting to .Net core : encryption problem

8 views
Skip to first unread message

Ruben Willems

unread,
Jun 6, 2019, 3:18:54 AM6/6/19
to ccnet-devel
Hi all

CCNet uses the RSACryptoServiceProvider, and now I get a
Operation is not supported on this platform  exception.

What would the best option be for solving this?
° making a dependency on Full.Net is not an option 
    that would make the port to .Net core obsolete
° using AES encryption ?
° using NETCore.Encrypt
     that could solve it, since it has RSA, but seems not active anymore
° ...


Below a console app that simulates the problem.

using System;
using System.Security.Cryptography;

namespace CoreEncryption
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                var cp = new CspParameters();
                cp.KeyContainerName = "CruiseControl.NET Server";
                var provider = new RSACryptoServiceProvider(cp);
                // Return the public key
                string result = provider.ToXmlString(false);
                Console.WriteLine(result);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
    }
}


with kind regards
Ruben Willems

Sören Mühlbauer

unread,
Jun 6, 2019, 11:08:31 AM6/6/19
to Ruben Willems, ccnet-devel
Reply all
Reply to author
Forward
0 new messages