<?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>Jabbering Giraffe &#187; gnupg</title>
	<atom:link href="http://happygiraffe.net/blog/tag/gnupg/feed/" rel="self" type="application/rss+xml" />
	<link>http://happygiraffe.net/blog</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 20:49:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>gnupg very basically</title>
		<link>http://happygiraffe.net/blog/2009/06/24/gnupg-very-basically/</link>
		<comments>http://happygiraffe.net/blog/2009/06/24/gnupg-very-basically/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 20:56:48 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gnupg]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1543</guid>
		<description><![CDATA[I&#8217;m trying to get jslint4java into central, via oss.sonatype.org. Part of this requires that you use the maven-gpg-plugin to sign your artifacts. All well &#038; good, but I&#8217;ve never used GPG before (though I&#8217;ve been playing with SSL certificates for &#8230; <a href="http://happygiraffe.net/blog/2009/06/24/gnupg-very-basically/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to get <a href="http://code.google.com/p/jslint4java/">jslint4java</a> into <a href="http://repo1.maven.org/maven2/">central</a>, via <a href="https://docs.sonatype.com/display/NX/OSS+Repository+Hosting">oss.sonatype.org</a>.  Part of this requires that you use the <a href="http://maven.apache.org/plugins/maven-gpg-plugin/">maven-gpg-plugin</a> to sign your artifacts.  All well &#038; good, but I&#8217;ve never used <a href="http://www.gnupg.org/">GPG</a> before (though I&#8217;ve been playing with SSL certificates for years).</p>
<p>So, following along the <a href="http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto-3.html">howto</a>, I did:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ gpg <span style="color: #660033;">--gen-key</span>
gpg <span style="color: #7a0874; font-weight: bold;">&#40;</span>GnuPG<span style="color: #7a0874; font-weight: bold;">&#41;</span> 1.4.9; Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>C<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">2008</span> Free Software Foundation, Inc.
This is <span style="color: #c20cb9; font-weight: bold;">free</span> software: you are <span style="color: #c20cb9; font-weight: bold;">free</span> to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
&nbsp;
Please <span style="color: #000000; font-weight: bold;">select</span> what kind of key you want:
   <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> DSA and Elgamal <span style="color: #7a0874; font-weight: bold;">&#40;</span>default<span style="color: #7a0874; font-weight: bold;">&#41;</span>
   <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> DSA <span style="color: #7a0874; font-weight: bold;">&#40;</span>sign only<span style="color: #7a0874; font-weight: bold;">&#41;</span>
   <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">5</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> RSA <span style="color: #7a0874; font-weight: bold;">&#40;</span>sign only<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Your selection? <span style="color: #000000;">1</span>
DSA keypair will have <span style="color: #000000;">1024</span> bits.
ELG-E keys may be between <span style="color: #000000;">1024</span> and <span style="color: #000000;">4096</span> bits long.
What keysize <span style="color: #000000; font-weight: bold;">do</span> you want? <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2048</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Requested keysize is <span style="color: #000000;">2048</span> bits
Please specify how long the key should be valid.
         <span style="color: #000000;">0</span> = key does not expire
      <span style="color: #000000; font-weight: bold;">&lt;</span>n<span style="color: #000000; font-weight: bold;">&gt;</span>  = key expires <span style="color: #000000; font-weight: bold;">in</span> n days
      <span style="color: #000000; font-weight: bold;">&lt;</span>n<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">w</span> = key expires <span style="color: #000000; font-weight: bold;">in</span> n weeks
      <span style="color: #000000; font-weight: bold;">&lt;</span>n<span style="color: #000000; font-weight: bold;">&gt;</span>m = key expires <span style="color: #000000; font-weight: bold;">in</span> n months
      <span style="color: #000000; font-weight: bold;">&lt;</span>n<span style="color: #000000; font-weight: bold;">&gt;</span>y = key expires <span style="color: #000000; font-weight: bold;">in</span> n years
Key is valid <span style="color: #000000; font-weight: bold;">for</span>? <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">0</span>
Key does not expire at all
Is this correct? <span style="color: #7a0874; font-weight: bold;">&#40;</span>y<span style="color: #000000; font-weight: bold;">/</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span> y
&nbsp;
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address <span style="color: #000000; font-weight: bold;">in</span> this form:
    <span style="color: #ff0000;">&quot;Heinrich Heine (Der Dichter) &lt;heinrichh@duesseldorf.de&gt;&quot;</span>
&nbsp;
Real name: Dominic Mitchell
Email address: dom<span style="color: #000000; font-weight: bold;">@</span>happygiraffe.net
Comment:
You selected this USER-ID:
    <span style="color: #ff0000;">&quot;Dominic Mitchell &lt;dom@happygiraffe.net&gt;&quot;</span>
&nbsp;
Change <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>ame, <span style="color: #7a0874; font-weight: bold;">&#40;</span>C<span style="color: #7a0874; font-weight: bold;">&#41;</span>omment, <span style="color: #7a0874; font-weight: bold;">&#40;</span>E<span style="color: #7a0874; font-weight: bold;">&#41;</span>mail or <span style="color: #7a0874; font-weight: bold;">&#40;</span>O<span style="color: #7a0874; font-weight: bold;">&#41;</span>kay<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>Q<span style="color: #7a0874; font-weight: bold;">&#41;</span>uit? O
You need a Passphrase to protect your secret key.
&nbsp;
We need to generate a lot of random bytes. It is a good idea to perform
some other action <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">type</span> on the keyboard, move the mouse, utilize the
disks<span style="color: #7a0874; font-weight: bold;">&#41;</span> during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
+++++.++++++++++.++++++++++.+++++++++++++++.+++++++++++++++.+++++...++++++++++.+++++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++<span style="color: #000000; font-weight: bold;">&gt;</span>++++++++++<span style="color: #000000; font-weight: bold;">&gt;</span>+++++......+++++
We need to generate a lot of random bytes. It is a good idea to perform
some other action <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">type</span> on the keyboard, move the mouse, utilize the
disks<span style="color: #7a0874; font-weight: bold;">&#41;</span> during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
..++++++++++++++++++++.++++++++++++++++++++++++++++++...++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++.+++++++++++++++.+++++...++++++++++.+++++<span style="color: #000000; font-weight: bold;">&gt;</span>.++++++++++<span style="color: #000000; font-weight: bold;">&gt;</span>..+++++<span style="color: #000000; font-weight: bold;">&gt;</span>+++++.......+++++^^^
gpg: <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>dom<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>trustdb.gpg: trustdb created
gpg: key A24D5076 marked <span style="color: #c20cb9; font-weight: bold;">as</span> ultimately trusted
public and secret key created and signed.
&nbsp;
gpg: checking the trustdb
gpg: <span style="color: #000000;">3</span> marginal<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> needed, <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">complete</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> needed, PGP trust model
gpg: depth: <span style="color: #000000;">0</span>  valid:   <span style="color: #000000;">1</span>  signed:   <span style="color: #000000;">0</span>  trust: <span style="color: #000000;">0</span>-, 0q, 0n, 0m, 0f, 1u
pub   1024D<span style="color: #000000; font-weight: bold;">/</span>A24D5076 <span style="color: #000000;">2009</span>-06-<span style="color: #000000;">24</span>
      Key fingerprint = 2F2E 85D8 A945 41C2 B7D1  667A <span style="color: #000000;">8616</span> 2CE5 A24D <span style="color: #000000;">5076</span>
uid                  Dominic Mitchell <span style="color: #000000; font-weight: bold;">&lt;</span>dom<span style="color: #000000; font-weight: bold;">@</span>happygiraffe.net<span style="color: #000000; font-weight: bold;">&gt;</span>
sub   2048g<span style="color: #000000; font-weight: bold;">/</span>4C2D8074 <span style="color: #000000;">2009</span>-06-<span style="color: #000000;">24</span></pre></div></div>

<p>As an aside, I am using gnupg 1, as I had some issues with the maven-plugin and gnupg 2.  And it was simpler to just install gnupg 1 than fix the issues. <img src='http://happygiraffe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This creates a bunch of files in <code>~/.gnupg</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> ~<span style="color: #000000; font-weight: bold;">/</span>.gnupg
total <span style="color: #000000;">64</span>
<span style="color: #660033;">-rw-------</span>  <span style="color: #000000;">1</span> dom  dom  <span style="color: #000000;">9154</span> <span style="color: #000000;">21</span> Jun <span style="color: #000000;">20</span>:<span style="color: #000000;">39</span> gpg.conf
<span style="color: #660033;">-rw-------</span>  <span style="color: #000000;">1</span> dom  dom  <span style="color: #000000;">1171</span> <span style="color: #000000;">24</span> Jun <span style="color: #000000;">20</span>:<span style="color: #000000;">44</span> pubring.gpg
<span style="color: #660033;">-rw-------</span>  <span style="color: #000000;">1</span> dom  dom  <span style="color: #000000;">1171</span> <span style="color: #000000;">24</span> Jun <span style="color: #000000;">20</span>:<span style="color: #000000;">44</span> pubring.gpg~
<span style="color: #660033;">-rw-------</span>  <span style="color: #000000;">1</span> dom  dom   <span style="color: #000000;">600</span> <span style="color: #000000;">24</span> Jun <span style="color: #000000;">20</span>:<span style="color: #000000;">44</span> random_seed
<span style="color: #660033;">-rw-------</span>  <span style="color: #000000;">1</span> dom  dom  <span style="color: #000000;">1320</span> <span style="color: #000000;">24</span> Jun <span style="color: #000000;">20</span>:<span style="color: #000000;">44</span> secring.gpg
<span style="color: #660033;">-rw-------</span>  <span style="color: #000000;">1</span> dom  dom  <span style="color: #000000;">1280</span> <span style="color: #000000;">24</span> Jun <span style="color: #000000;">20</span>:<span style="color: #000000;">44</span> trustdb.gpg</pre></div></div>

<p>Next, it needs to be published on to one of the key servers.  The default configuration comes set up with a keyserver <a href="http://keys.gnupg.net/">keys.gnupg.net</a>.  You can send your key up there easily:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ gpg <span style="color: #660033;">--send-keys</span> A24D5076
gpg: sending key A24D5076 to hkp server keys.gnupg.net</pre></div></div>

<p>And now it&#8217;s <a href="http://keys.gnupg.net/pks/lookup?search=happygiraffe&#038;op=vindex">published</a>.</p>
<p>Integrating this with your maven build is fairly simple.  The <a href="http://maven.apache.org/plugins/maven-gpg-plugin/usage.html">example configuration</a> works exactly as expected.  I did one thing slightly differently: I created a <em>gpg</em> profile, and then referenced that from the release plugin.  That means I&#8217;ll only sign releases, not all builds.  Which seems reasonable enough to me.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pluginManagement<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.apache.maven.plugins<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>maven-release-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.0-beta-9<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;releaseProfiles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>gpg<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/releaseProfiles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pluginManagement<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;profiles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;profile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>gpg<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.apache.maven.plugins<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>maven-gpg-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            …
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/profile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/profiles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2009/06/24/gnupg-very-basically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

