Beispiel #1
0
 private Task SendOfflineMessageCommandAsync(Stream stream)
 {
     try
     {
         if (UserIsAuth)
         {
             var offlineMessage = SerializerF.Deserialize <OfflineMessageForm>(stream, false);
             var result         = new ResultOfOperation();
             Core.SendOfflineMessage(offlineMessage, Form, result);
             return(ReturnResultToClientAsync(result, true));
         }
         else
         {
             return(SendResultWithError(1, 1, false));
         }
     }
     catch (SerializationException ex)
     {
         return(SendResultWithError(1, 0, true));
     }
     catch (Exception)
     {
         return(SendResultWithError(1, 2, true));
     }
 }
Beispiel #2
0
        public virtual void Import(byte[] keys)
        {
            var rsaParams = Ser.Deserialize <RSAParameters>(keys, false);

            Rsa.ImportParameters(rsaParams);
        }