Use X509CertificateLoader for literal public certificate data

Proprietary

Replace X509Certificate2(Convert.FromBase64String(...)) only when a literal, or a closed local initialized from a literal, proves one loadable public DER/PEM certificate. Preserve the decoder and its argument evaluation. Skip passwords, key flags, other containers, mutable/escaped locals, comments, object initializers, lambda/query contexts, unresolved APIs and conditional snapshots. Opt-in; no trust, key-storage or algorithm policy change.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.UseX509CertificateLoaderForLiteralPublicData
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.UseX509CertificateLoaderForLiteralPublicData

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.