public bool SetStoreSeed(Seed seed) { var now = DateTime.UtcNow; if (seed == null || seed.Name != null || seed.Comment != null || seed.Keywords.Count != 1 || seed.Keywords[0] != ConnectionsManager.Keyword_Store || (seed.CreationTime - now).Minutes > 30) return false; if (seed.Certificate == null) throw new CertificateException(); var signature = seed.Certificate.ToString(); // なるべく電子署名の検証をさけ、CPU使用率を下げるよう工夫する。 lock (_thisLock) { Seed tempSeed; if (!this.StoreSeeds.TryGetValue(signature, out tempSeed) || seed.CreationTime > tempSeed.CreationTime) { if (!seed.VerifyCertificate()) throw new CertificateException(); this.StoreSeeds[signature] = seed; } return (tempSeed == null || seed.CreationTime >= tempSeed.CreationTime); } }