Exemplo n.º 1
0
 /// <summary>
 /// Fires a decrypt thread with a callback the encrypts it again, used to make the keys current
 /// </summary>
 /// <param name="path"></param>
 private void recrypt(string path)
 {
     string     tmpFile = Path.GetTempFileName();
     GpgDecrypt decrypt = new GpgDecrypt(path, tmpFile);
     {
         // The current thread is blocked until the decryption is finished.
         GpgInterfaceResult result = decrypt.Execute();
         Decrypt_Callback(result, tmpFile, path);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Decrypt the file into a tempfile
        /// </summary>
        /// <param name="path"></param>
        /// <param name="clear"></param>
        private void decrypt_pass(string path, bool clear = true)
        {
            FileInfo f = new FileInfo(path);

            if (f.Length > 0)
            {
                tmpfile = Path.GetTempFileName();
                GpgDecrypt decrypt = new GpgDecrypt(path, tmpfile);
                {
                    // The current thread is blocked until the decryption is finished.
                    GpgInterfaceResult result = decrypt.Execute();
                    Decrypt_Callback(result, clear);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Decrypt the file into a tempfile
        /// </summary>
        /// <param name="path"></param>
        /// <param name="clear"></param>
        private void DecryptPass(string path, bool clear = true)
        {
            log.Debug("Start decryption of: " + path);
            var f = new FileInfo(path);

            if (f.Exists && f.Length > 0)
            {
                this.tmpfile = Path.GetTempFileName();
                var decrypt = new GpgDecrypt(path, this.tmpfile);
                {
                    // The current thread is blocked until the decryption is finished.
                    var result = decrypt.Execute();
                    this.DecryptCallback(result, clear);
                }
            }
            else
            {
                txtPassDetail.Text = Strings.FrmMain_DecryptPass_Empty_file;
                ShowHTML(txtPassDetail.Text);
            }
        }