<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="https://forum.yubico.com/feed.php?f=5&amp;t=2605" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2017-03-19T06:44:16+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=5&amp;t=2605</id>
<entry>
<author><name><![CDATA[drcheese]]></name></author>
<updated>2017-03-19T06:43:43+01:00</updated>
<published>2017-03-19T06:43:43+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=2605&amp;p=9480#p9480</id>
<link href="https://forum.yubico.com/viewtopic.php?t=2605&amp;p=9480#p9480"/>
<title type="html"><![CDATA[Re: Problems generating keys for YK-KSM]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=2605&amp;p=9480#p9480"><![CDATA[
Solved...<br /><br />Create ~/.gnupg/gpg-agent.conf and add this one line:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">max-cache-ttl 0</div><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=4741">drcheese</a> — Sun Mar 19, 2017 6:43 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drcheese]]></name></author>
<updated>2017-03-19T06:16:33+01:00</updated>
<published>2017-03-19T06:16:33+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=2605&amp;p=9479#p9479</id>
<link href="https://forum.yubico.com/viewtopic.php?t=2605&amp;p=9479#p9479"/>
<title type="html"><![CDATA[Re: Problems generating keys for YK-KSM]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=2605&amp;p=9479#p9479"><![CDATA[
Okay, so that was quick. I have half of my solution.<br /><br />Basically the gpg2 does not allow forcing entry of the passphrase all the time so you have to cache it somehow. I did this by creating a dummy file called test.txt and creating a signature for it via the command:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">gpg --clearsign test.txt</div><br /><br />That caused the passphrase prompt:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">   lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk<br />   x Please enter the passphrase to unlock the secret key for the OpenPGP  x<br />   x certificate:                                                          x<br />   x &quot;YK-KSM Import Key&quot;                                                   x<br />   x 2048-bit RSA key, ID XXXXXXXX,                                        x<br />   x created 2017-03-19.                                                   x<br />   x                                                                       x<br />   x                                                                       x<br />   x Passphrase __________________________________________________________ x<br />   x                                                                       x<br />   x          &lt;OK&gt;                                         &lt;Cancel&gt;        x<br />   mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj<br /></div><br /><br />However this did not fix the importer issue where it did not prompt for the passphrase a second time. Any help on this? I can't seem to get around this issue.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=4741">drcheese</a> — Sun Mar 19, 2017 6:16 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drcheese]]></name></author>
<updated>2017-03-19T06:44:16+01:00</updated>
<published>2017-03-19T06:03:59+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=2605&amp;p=9478#p9478</id>
<link href="https://forum.yubico.com/viewtopic.php?t=2605&amp;p=9478#p9478"/>
<title type="html"><![CDATA[[SOLVED] Problems generating keys for YK-KSM]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=2605&amp;p=9478#p9478"><![CDATA[
So I have a gpg key generated per the tutorial here: <a href="https://developers.yubico.com/yubikey-ksm/Generate_KSM_Key.html" class="postlink">https://developers.yubico.com/yubikey-ksm/Generate_KSM_Key.html</a><br /><br />However gpg does not request my passphrase when I try to generate KSM keys via:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">ykksm-gen-keys --urandom 1 5 | gpg -a --encrypt -r XXXXXXXX -s &gt; keys.txt</div><br /><br />The output ends as follows:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">gpg: cancelled by user<br />gpg: no default secret key: Operation cancelled<br />gpg: &#91;stdin&#93;: sign+encrypt failed: Operation cancelled<br /></div><br /><br />I found a possible workaround by using the following:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">gpg -r XXXXXXXX--output keys.txt.gpg --encrypt keys.txt</div><br /><br />But then the importer gives me a similar error, expecting a passphrase to unlock the secret key and it never prompting for one:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">&#91;GNUPG:&#93; ENC_TO XXXXXXXXXXXXXXXX 1 0<br />&#91;GNUPG:&#93; USERID_HINT XXXXXXXXXXXXXXXX YK-KSM Import Key<br />&#91;GNUPG:&#93; NEED_PASSPHRASE XXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYYYY 1 0<br />gpg: cancelled by user<br />&#91;GNUPG:&#93; MISSING_PASSPHRASE<br />gpg: encrypted with 2048-bit RSA key, ID ZZZZZZZZZ, created 2017-03-19<br />      &quot;YK-KSM Import Key&quot;<br />gpg: public key decryption failed: Operation cancelled<br />&#91;GNUPG:&#93; ERROR pkdecrypt_failed 99<br />&#91;GNUPG:&#93; BEGIN_DECRYPTION<br />&#91;GNUPG:&#93; DECRYPTION_FAILED<br />gpg: decryption failed: No secret key<br />&#91;GNUPG:&#93; END_DECRYPTION<br />encrypted to: XXXXXXXXXXXXXXXX <br />signed by:<br />Input not signed? at /usr/bin/ykksm-import line 122.</div><br /><br />I realize this may be a specific issue with gpg2 configuration in CentOS 7, but thought someone else may have run into this issue too. Any help is greatly appreciated.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=4741">drcheese</a> — Sun Mar 19, 2017 6:03 am</p><hr />
]]></content>
</entry>
</feed>