private static Common.Output EncryptMessageFromkiosk(string message) { try { _db = new PilaDbContext(); ConnectionInfo profile = _db.ConnectionInfoes.First(c => c.Active == 1); if (profile != null) { var keyValue = Encoding.ASCII.GetString(profile.PublicKey); KeyManager keyM = new KeyManager(); var encrypted = keyM.EncryptPGP(profile.KeyName, profile.KeyName, profile.KeyPass, message, profile.PublicKey); if (!string.IsNullOrEmpty(encrypted.Value = "0")) { return(new Common.Output("FAILED", "0", DateTime.Now, false, "Encryption Error : " + encrypted.Notes)); } return(new Common.Output("SUCCESS", "1", DateTime.Now, true, encrypted.Notes)); } return(new Common.Output("HALTED", "0", DateTime.Now, false, "PROFILING ERROR ")); } catch (Exception ex) { return(new Common.Output("FAILED", "0", DateTime.Now, false, "Encryption Error : " + ex.Message)); } }