예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }