public HandshakeWithNoiseProtocol(NodeContext nodeContext, byte[]?remotePubKey,
                                          IHandshakeProcessor noiseProtocol)
        {
            PrivateKey = nodeContext.PrivateKey;
            if (remotePubKey != null)
            {
                RemotePubKey = remotePubKey;
                Initiator    = true;
            }

            _noiseProtocol = noiseProtocol;
            _noiseProtocol.InitiateHandShake(PrivateKey);
        }
Exemplo n.º 2
0
        public TransportMessageSerializer(
            ILogger <TransportMessageSerializer> logger,
            INetworkMessageSerializerManager networkMessageSerializerManager,
            NodeContext nodeContext,
            IHandshakeProcessor handshakeProcessor)
        {
            _logger = logger;
            _networkMessageSerializerManager = networkMessageSerializerManager;
            _nodeContext            = nodeContext;
            _handshakeProcessor     = handshakeProcessor;
            _deserializationContext = new DeserializationContext();

            //initialized by SetPeerContext
            _networkPeerContext = null !;
            _handshakeProtocol  = null !;
        }