I’m using the Octopus Certificates feature to store certificates that are used in signing SAML2 xml messages. If I create a self-signed certificate via the Add Certificate feature, it creates a new certificate that uses a certificate key algorithm that is not supported by .NET (without refactoring).
It looks like the self-signed certificates created by Octopus use ECD as a key algorithm, which causes an exception in .NET code that looks something like:
var certs = store.Certificates.Find(X509FindType.FindByThumbprint, thumbprint, false);
var cert = certs[0];
// Exception here when accessing cert.PublicKey.Key "The certificate key algorithm is not supported."
Console.WriteLine($"Pub Key Algorythm: {cert.PublicKey.Key.SignatureAlgorithm}");
Is it possible to generate Self-Signed certificates using another key Algorithm that is supported by .NET?
Note: I appreciate it may well be possible to re-factor the C# code to use cert.GetECDsaPrivateKey(), but the code is in a library that is out of my control