Certificate generator class used to create an X509 cert with exportable privatekey and optionally add to the personal store
 private CertificateGenerator BuildCertGenerator(string name, string password)
 {
     var generator = new CertificateGenerator(SubscriptionId, ManagementCertificate);
     generator.Create(name, DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)), DateTime.UtcNow.AddYears(2), password);
     return generator;
 }
 /// <summary>
 /// Used to create the Cert
 /// </summary>
 public X509Certificate2 Create()
 {
     var generator = new CertificateGenerator();
     return generator.Create(Name, ValidFrom, ValidTo, PvkPassword, true);
 }