コード例 #1
0
        public void AddPrivateKey(PeerId p, PrivateKey sk)
        {
            if (sk == null)
            {
                throw new ArgumentNullException(nameof(sk));
            }

            if (!p.MatchesPrivateKey(sk))
            {
                throw new Exception("Id does not match PrivateKey");
            }

            _sync.Lock(() => _sks[p] = sk);
        }