public async Task AddServiceIdentityCertificateAsync(string key, string path, string password) { IServiceIdentity identity = GetServiceIdentity(key); X509Certificate2 cert = new X509Certificate2(path, password); if (cert != null) { byte[] certBytes = cert.Export(X509ContentType.Pfx, password); await identity.AddCertificateAsync(certBytes); } }
public async Task AddServiceIdentityCertificateAsync(string key, string store, string location, string thumbprint, string password) { IServiceIdentity identity = GetServiceIdentity(key); X509Certificate2 cert = GetLocalCertificate(store, location, thumbprint); if (cert != null) { byte[] certBytes = cert.Export(X509ContentType.Pfx, password); await identity.AddCertificateAsync(certBytes); } }