protected override void encryptKey(ref EncryptedMessage em, Guid remoteId) { if (KeyEncryption is NoKey) { return; } em.Key = KeyEncryption.EncryptData(em.Key, HubPublicKey?.Key); em.KeyType = KeyEncryption.Type; }
protected override void encryptKey(ref EncryptedMessage em, Guid remoteId) { if (KeyEncryption is NoKey) { return; } if (!NodesPublicKeys.ContainsKey(remoteId)) { throw new Exception(String.Format("No RSA public key for node \"{0}\" found!", remoteId.ToString())); } em.Key = KeyEncryption.EncryptData(em.Key, NodesPublicKeys[remoteId].Key); em.KeyType = KeyEncryption.Type; }