Click here to Skip to main content
15,893,564 members
Home / Discussions / C#
   

C#

 
GeneralRe: Difference between Methods and Functions? Pin
Luc Pattyn10-Jul-09 13:22
sitebuilderLuc Pattyn10-Jul-09 13:22 
GeneralRe: Difference between Methods and Functions? Pin
PIEBALDconsult10-Jul-09 13:46
mvePIEBALDconsult10-Jul-09 13:46 
AnswerRe: Difference between Methods and Functions? Pin
Alan Balkany13-Jul-09 4:23
Alan Balkany13-Jul-09 4:23 
QuestionDataGridView add row performance Pin
Dan Neely10-Jul-09 8:45
Dan Neely10-Jul-09 8:45 
QuestionIVR Pin
kenant10-Jul-09 8:05
kenant10-Jul-09 8:05 
QuestionRe: IVR Pin
harold aptroot10-Jul-09 8:07
harold aptroot10-Jul-09 8:07 
AnswerRe: IVR Pin
Dr.Walt Fair, PE10-Jul-09 10:36
professionalDr.Walt Fair, PE10-Jul-09 10:36 
QuestionGnuPG / GnuPGWrapper from C# Pin
davidmgray_de10-Jul-09 5:09
davidmgray_de10-Jul-09 5:09 
Help.

Has anyone managed to get GnuPG working from C#?

I have installed the latest version of GnuPG and downloaded the wrapper GnuPGWrapper from this site.
I've created a new registry key called HomeDir in HKEY_CURRENT_USER\Software\GNU\GnuPG with a value
of "C:\Program Files\GNU\GnuPG\" the gpg.exe and keyring files are also in this location.

When I run my simple console application I get this error.

"Emmanuel.Cryptography.GnuPG.GnuPGException was unhandled
Message="gpg: keyblock resource `C:/Program Files/GNU/GnuPG\" --yes --batch --encrypt --armor --recipient crypto@turpin-distribution.com --default-key crypto@turpin-distribution.com --passphrase-fd 0 --no-verbose \\secring.gpg': file open error\r\ngpg: keyblock resource `C:/Program Files/GNU/GnuPG\" --yes --batch --encrypt --armor --recipient crypto@turpin-distribution.com --default-key crypto@turpin-distribution.com --passphrase-fd 0 --no-verbose \\pubring.gpg': file open error\r\ngpg: no valid OpenPGP data found.\r\ngpg: processing message failed: eof\r\n"
"

Has anyone got a working example of this that they would be kind enough to post as I've now pulled all my hair out Smile | :)

My console application looks like this..


using System;
using Emmanuel.Cryptography.GnuPG; 


namespace FileSystemExample
{
    class FileExample
    {
        public static void Main()
        {
            string inputText; 
            string outputText; 

            GnuPGWrapper gpg = new GnuPGWrapper();
            gpg.command = Commands.Encrypt;
            gpg.homedirectory = @"C:\Program Files\GNU\GnuPG\";
            gpg.passphrase = "fred"; 

            gpg.originator = "crypto@turpin-distribution.com";
            gpg.recipient = "crypto@turpin-distribution.com";


            inputText = "Hello World"; 

            gpg.ExecuteCommand(inputText, out outputText);

            Console.WriteLine("Input = {0}, Output = {1}", inputText,outputText);
        }
    }
}

AnswerRe: GnuPG / GnuPGWrapper from C# Pin
MumbleB10-Jul-09 6:57
MumbleB10-Jul-09 6:57 
QuestionRegex.Remove Pin
Wheels01210-Jul-09 5:07
Wheels01210-Jul-09 5:07 
AnswerRe: Regex.Remove Pin
riced10-Jul-09 5:26
riced10-Jul-09 5:26 
GeneralRe: Regex.Remove Pin
Wheels01210-Jul-09 5:29
Wheels01210-Jul-09 5:29 
GeneralRe: Regex.Remove Pin
riced10-Jul-09 5:39
riced10-Jul-09 5:39 
GeneralRe: Regex.Remove Pin
Wheels01210-Jul-09 5:41
Wheels01210-Jul-09 5:41 
GeneralRe: Regex.Remove Pin
riced10-Jul-09 6:07
riced10-Jul-09 6:07 
GeneralRe: Regex.Remove Pin
Wheels01210-Jul-09 6:11
Wheels01210-Jul-09 6:11 
GeneralRe: Regex.Remove Pin
riced10-Jul-09 6:16
riced10-Jul-09 6:16 
AnswerRe: Regex.Remove Pin
Henry Minute10-Jul-09 5:37
Henry Minute10-Jul-09 5:37 
GeneralRe: Regex.Remove Pin
Wheels01210-Jul-09 5:45
Wheels01210-Jul-09 5:45 
GeneralRe: Regex.Remove Pin
DoctorMick10-Jul-09 6:13
DoctorMick10-Jul-09 6:13 
GeneralRe: Regex.Remove Pin
Henry Minute10-Jul-09 6:20
Henry Minute10-Jul-09 6:20 
AnswerRe: Regex.Remove Pin
Henry Minute10-Jul-09 6:57
Henry Minute10-Jul-09 6:57 
GeneralRe: Regex.Remove Pin
OriginalGriff10-Jul-09 8:27
mveOriginalGriff10-Jul-09 8:27 
GeneralRe: Regex.Remove Pin
Henry Minute10-Jul-09 10:09
Henry Minute10-Jul-09 10:09 
QuestionParse Parenthesis Block in String Pin
dataminers10-Jul-09 4:51
dataminers10-Jul-09 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.