Пример #1
0
        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;
        }
Пример #2
0
        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;
        }