Brunet.Security.PeerSec.PeerSecAssociation.Reset C# (CSharp) Метод

Reset() публичный Метод

public Reset ( ) : void
Результат void
    public void Reset() {
      lock(_sync) {
        _last_update = DateTime.UtcNow;
        _last_called_request_update = DateTime.UtcNow;

        _local_cert = new WriteOnceX509();
        _remote_cert = 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;
        _receiving = true;
        _sending = true;
      }

      UpdateState(States.Active, States.Updating);
    }

Usage Example

Пример #1
0
        protected void Setup(PeerSecAssociation sa1, PeerSecAssociation sa2)
        {
            sa1.Reset();
            sa2.Reset();
            sa1.RDHE.Value = sa2.LDHE;
            sa2.RDHE.Value = sa1.LDHE;

            Random rand = new Random();

            byte[] b = new byte[128];
            rand.NextBytes(b);
            MemBlock mb = MemBlock.Reference(b);

            sa1.DHEWithCertificateAndCAsOutHash.Value = mb;
            sa1.VerifyResponse(mb);

            b = new byte[128];
            rand.NextBytes(b);
            mb = MemBlock.Reference(b);

            sa2.DHEWithCertificateHash.Value = mb;
            sa2.VerifyRequest(mb);

            sa1.Enable();
            sa2.Enable();
            // This is just for kicks
            sa1.Enable();
        }
All Usage Examples Of Brunet.Security.PeerSec.PeerSecAssociation::Reset