/// <summary> /// Sends broad cast the specified message bus. /// </summary> /// <param name="messageControl">The message control.</param> public void Send(IControlMessage messageControl) { foreach (Subscriptor subscriptor in _subscriptorsRepository.GetAll()) { subscriptor.ServiceInputControlGateway.Send(messageControl); } }
public static void SignControlMessage(this ECDsa key, IControlMessage message) { message.Signature = new() { Key = ByteString.CopyFrom(key.PublicKey()), Sign = ByteString.CopyFrom(key.SignData(message.SignData.ToByteArray())), }; }
/// <summary> /// Sends the specified identification. /// </summary> /// <param name="identification">The identification.</param> /// <param name="messageControl">The message control.</param> public void Send(Identification identification, IControlMessage messageControl) { Subscriptor subscriptor = _subscriptorsRepository.Get(identification); if (subscriptor != null) { subscriptor.ServiceInputControlGateway.Send(messageControl); } }
public void SendControlCommand(IControlMessage msg) { if (controlClient == null) { log.Warning("SendControlCommand() called, but controlClient is null."); } else { controlChannel.Writer.TryWrite(msg); } }
/// <summary> /// Publishes the specified identification. /// </summary> /// <param name="identification">The identification.</param> /// <param name="message">The message.</param> public void Publish(Identification identification, IControlMessage message) { _subscriptonsHelper.Send(identification, message); }
public static bool VerifyControlMessage(this IControlMessage message) { using var key = message.Signature.Key.ToByteArray().LoadPublicKey(); return(key.VerifyData(message.SignData.ToByteArray(), message.Signature.Sign.ToByteArray())); }