public async Task <Guid> Urn(Guid questionId, string name, byte[][] authorities, KeysPair keys) { var exist = urns.SingleOrDefault(o => o.QuestionId == questionId && o.Name == name); if (exist != null) { return(exist.Id); } var urn = new Urn { Id = Guid.NewGuid(), QuestionId = questionId, Name = name, Authorities = authorities }; var signer = new Signer(service); urn.Signature = signer.Sign(urn.GetData(), keys); urn.PublicKey = new byte[keys.PublicKey.Length]; Buffer.BlockCopy(keys.PublicKey, 0, urn.PublicKey, 0, keys.PublicKey.Length); await publisher.Add(urn); urns.Add(urn); return(urn.Id); }