<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The adventures of Foo &#187; Crypto</title>
	<atom:link href="http://jensge.org/tag/crypto/feed/" rel="self" type="application/rss+xml" />
	<link>http://jensge.org</link>
	<description>My aggregated random tech blabber</description>
	<lastBuildDate>Sat, 04 Feb 2012 19:12:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Return of the struggle</title>
		<link>http://jensge.org/2009/04/return-of-the-struggle/</link>
		<comments>http://jensge.org/2009/04/return-of-the-struggle/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 14:51:11 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Crypto]]></category>
		<category><![CDATA[NoteToMyself]]></category>
		<category><![CDATA[OSS]]></category>

		<guid isPermaLink="false">https://jensge.org/?p=200</guid>
		<description><![CDATA[If you ever wondered what parameters you could pass in that funny xmllet &#60;GnupgKeyParms&#62;&#60;/GnupgKeyParms&#62; when using gpgme_op_genkey: The answer to that is in the gnupg source, file g10/keygen.c, line 2363 at http://lists.gnupg.org/pipermail/gnupg-users/2007-February/030330.html at doc/DETAILS, line 716.]]></description>
			<content:encoded><![CDATA[<p>If you ever wondered what parameters you could pass in that funny xmllet <code>&lt;GnupgKeyParms&gt;&lt;/GnupgKeyParms&gt;</code> when using <code>gpgme_op_genkey</code>:</p>
<p>The answer to that is</p>
<ul>
<li>in the gnupg source, file <code>g10/keygen.c</code>, line 2363</li>
<li>at <a href="http://lists.gnupg.org/pipermail/gnupg-users/2007-February/030330.html" target="_blank">http://lists.gnupg.org/pipermail/gnupg-users/2007-February/030330.html</a></li>
<li>at <code>doc/DETAILS</code>, line 716.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jensge.org/2009/04/return-of-the-struggle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eternal struggle</title>
		<link>http://jensge.org/2009/04/eternal-struggle/</link>
		<comments>http://jensge.org/2009/04/eternal-struggle/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 09:09:18 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Arbeit]]></category>
		<category><![CDATA[Crypto]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[NoteToMyself]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">https://jensge.org/?p=195</guid>
		<description><![CDATA[My current task is evaluation crypto (here: OpenPGP) solutions for Microsoft Windows; of course including GnuPG. Well, what do I say. While there is a nice installer for GnuPG on Windows available (either here or here), try to find one &#8230; <a href="http://jensge.org/2009/04/eternal-struggle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My current task is evaluation crypto (here: OpenPGP) solutions for Microsoft Windows; of course including <a href="http://www.gnupg.org" target="_blank">GnuPG</a>.</p>
<p>Well, what do I say. While there is a nice installer for GnuPG on Windows available (either <a href="http://gnupg.org/download/" target="_blank">here</a> or <a href="http://www.gpg4win.org/download.html" target="_blank">here</a>), try to find one for the gpgme supporting library&#8230; (including header and .lib import files for Visual Studio, that is).</p>
<p>You can guess&#8230; It&#8217;s all about build-your-own-stuff. It basically boils down to this:</p>
<p><em>Preparations</em></p>
<ul>
<li>Create a directory to collect all the stuff you will need (e.g. <code>C:\gpgme</code> with <code>bin</code>, <code>include</code> and <code>lib</code> sub folders)</li>
<li>Get <a href="http://www.mingw.org" target="_blank">mingw</a> and install it</li>
<li>Get <a href="http://www.mingw.org/wiki/MSYS" target="_blank">MSYS</a> and install it</li>
<li><a href="http://www.gnupg.org/download/index.en.html#libgpg-error" target="_blank">Download libgpg-error</a> and extract it</li>
<li><a href="http://www.gnupg.org/download/index.en.html#gpgme" target="_blank">Download gpgme</a> and extract it</li>
</ul>
<p><em>Compiling libgpg-error</em></p>
<ul>
<li>In the MSYS bash, change to the directory you extracted libgpg-error into and run <code>./configure --prefix=/mingw &amp;&amp; make install</code></li>
<li>Call <code>strip src/.libs/libgpg-error-0.dll src/gpg-error.exe</code> as MSVC can&#8217;t use gcc&#8217;s debug info anyway</li>
<li>Copy <code>src/gpg-error.exe and src/.libs/libgpg-error-0.dll</code> to the bin directory created above</li>
<li>Copy <code>src/.libs/libgpg-error-0.dll.def</code> to <code>lib/libgpg-error-0.def</code> (note the renaming; otherwise your program will look for a <code>libgpg-error-0.dll.dll</code>)</li>
<li>Open the Visual Studio Command Prompt</li>
<li>Call <code>lib /machine:i386 /def:lib\libgpg-error-0.def /out:lib\libgpg-error-0.lib</code> to create the import library</li>
<li>Copy <code>include/gpg-error.h</code> to include</li>
</ul>
<p><em>Compiling gpgme</em></p>
<ul>
<li>In the MSYS bash, run <code>./configure --prefix=/mingw &amp;&amp; make</code></li>
<li>Call <code>strip src/gpgme-w32spawn.exe src/.libs/libgpgme-11.dll</code></li>
<li>Copy <code>src/gpgme-w32spawn.exe</code> to <code>bin</code> <strong>Note:</strong> To use the gpgme library, this binary has to live either in the installation dir of gpg (set in windows registry key <code>HKLM\Software\GNU\GnuPG\Installation Directory</code>) or in <code>%PROGRAMFILES%\GNU\GnuPG</code>. <strong>Otherwise gpgme will not work!</strong></li>
<li>Copy <code>src/.libs/libgpgme-11.dll</code> to bin and <code>src/.libs/libgpgme-11.dll.def</code> to <code>lib/libgpgme-11.def</code> (Once again, note the renaming)</li>
<li>Call <code>lib /machine:i386 /def:lib\libgpgme-11.def /out:lib\libgpgme-11.lib</code> to create the import library</li>
<li>Copy <code>include/gpgme.h</code> to <code>include</code></li>
</ul>
<p><em>Optional: Creating the documentation</em></p>
<p>I was not able to create the documentation properly using cygwin so I did this on a Linux host. Install a TeX distribution of your choice as well as texinfo (for Debian Lenny this would mean installing the packages texinfo, texi2html and texlive). Call make pdf in the doc subdir to generate the PDF documentation and manually call <code>texi2html gpgme.texi</code> for a HTML document.</p>
<p><em>Summary</em></p>
<p>Now you can add the lib dir to your Visual Studio linker settings and the include dir to your C/C++ common settings. To make gpgme work, be sure you have the gpgme-w32spawn.exe installed properly as noted above.</p>
<p>I hope this helps to guide one or another through the struggle of getting gpgme on windows.</p>
<p><em>Q&amp;A</em></p>
<ul>
<li>
<blockquote><p>Q: gpgme does not find libgpg-error</p></blockquote>
<p>A: You did not call <code>make install</code> after compiling it</li>
<li>
<blockquote><p>Q: My program is looking for <code>{libgpg-error-0.dll.dll|libgpgme-11.dll.dll}</code></p></blockquote>
<p>A: You did not rename the .def file before calling <code>lib.exe</code></li>
<li>
<blockquote><p>Q: I did everything you said, but when I run my program, <code>gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP)</code> fails with <code>GPG_ERR_INV_ENGINE</code>. If I check the engine info, <code>info-&gt;version</code> is empty</p></blockquote>
<p>A: First of all, check if you copied <code>gpgme-w32spawn.exe</code> to the correct directory. If this is the case, actually, I have no idea what went wrong</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jensge.org/2009/04/eternal-struggle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

