Example #1
0
 /// <summary>
 /// Called after the application certificate update.
 /// </summary>
 protected virtual void OnCertificateUpdate(object sender, CertificateUpdateEventArgs e)
 {
     // disconnect all sessions
     InstanceCertificate = e.SecurityConfiguration.ApplicationCertificate.Certificate;
     foreach (var listener in TransportListeners)
     {
         listener.CertificateUpdate(e.CertificateValidator, InstanceCertificate, null);
     }
 }
Example #2
0
        /// <summary>
        /// Updates the validator with a new application certificate.
        /// </summary>
        public virtual async Task UpdateCertificate(SecurityConfiguration securityConfiguration)
        {
            lock (m_lock)
            {
                securityConfiguration.ApplicationCertificate.Certificate = null;
            }

            await Update(securityConfiguration);

            lock (m_callbackLock)
            {
                if (m_CertificateUpdate != null)
                {
                    var args = new CertificateUpdateEventArgs(securityConfiguration, GetChannelValidator());
                    m_CertificateUpdate(this, args);
                }
            }
        }
Example #3
0
        /// <summary>
        /// Updates the validator with a new application certificate.
        /// </summary>
        public virtual async Task UpdateCertificate(SecurityConfiguration securityConfiguration)
        {
            lock (m_lock)
            {
                securityConfiguration.ApplicationCertificate.Certificate = null;
            }

            await Update(securityConfiguration).ConfigureAwait(false);

            await securityConfiguration.ApplicationCertificate.LoadPrivateKeyEx(
                securityConfiguration.CertificatePasswordProvider).ConfigureAwait(false);

            lock (m_callbackLock)
            {
                if (m_CertificateUpdate != null)
                {
                    var args = new CertificateUpdateEventArgs(securityConfiguration, GetChannelValidator());
                    m_CertificateUpdate(this, args);
                }
            }
        }