@365 timviec, Welcome to Microsoft Q&A, you could try the following code to add a certificate to the machine.
var cerFileName = "B:\\entrust_2048_ca.cer";
X509Certificate2 certificate = new X509Certificate2(cerFileName);
using (X509Store store = new X509Store(StoreName.TrustedPeople, StoreLocation.LocalMachine))
{
store.Open(OpenFlags.ReadWrite);
store.Add(certificate); //where cert is an X509Certificate object
}
Hope my code could help you.
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.