Because X509Certificates provided by Mono do not have value based hashcodes, we had to implement this special class that compares the Raw Data of a certificate. This class is thread-safe.
Пример #1
0
        ///<summary>This is called when we want to reset the state of the SA after
        ///an equivalent time of two timeouts has occurred.</summary>
        public bool Reset()
        {
            lock (_sync) {
                if (_incoming && _last_update != DateTime.MinValue &&
                    (_last_update.AddMilliseconds(TIMEOUT * 2) > DateTime.UtcNow ||
                     _closed == 1))
                {
                    return(false);
                }

                _last_update = DateTime.UtcNow;
                _last_called_request_update = DateTime.UtcNow;

                LocalCertificate  = new WriteOnceX509();
                RemoteCertificate = new WriteOnceX509();
                DHEWithCertificateAndCAsInHash  = new WriteOnceIdempotent <MemBlock>();
                DHEWithCertificateAndCAsOutHash = new WriteOnceIdempotent <MemBlock>();
                DHEWithCertificateHash          = new WriteOnceIdempotent <MemBlock>();
                RDHE           = new WriteOnceIdempotent <MemBlock>();
                RemoteCookie   = new WriteOnceIdempotent <MemBlock>();
                _ldhe          = null;
                _hash_verified = false;
                _called_enable = 0;
                _incoming      = true;
                _running       = true;
            }

            if (State == SAState.Active)
            {
                State = SAState.Updating;
            }

            return(true);
        }