Esempio n. 1
0
        public Node(Network network, string nodeId)
        {
            if (network == null)
            {
                throw new ArgumentNullException(nameof(network));
            }

            if (nodeId.Length != 128)
            {
                throw new ArgumentException("Invalid NodeID specified.");
            }

            NodeID  = nodeId;
            Network = network;

            alg           = new RijndaelManaged();
            DiffieHellman = new DiffieHellmanManaged();

            if (nodeId != Network.Core.MyNodeID)
            {
                Directory = new NodeDirectory(Network.Core, this);
            }
        }
Esempio n. 2
0
        public Node(Network network, string nodeID)
        {
            if (network == null)
            {
                throw new ArgumentNullException("network");
            }

            if (nodeID.Length != 128)
            {
                throw new ArgumentException("Invalid NodeID specified.");
            }

            this.nodeID  = nodeID;
            this.network = network;

            alg           = new RijndaelManaged();
            diffieHellman = new DiffieHellmanManaged();

            if (nodeID != Core.MyNodeID)
            {
                directory = new NodeDirectory(this);
            }
        }