<?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=26&amp;t=1694" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2015-01-02T02:01:44+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=26&amp;t=1694</id>
<entry>
<author><name><![CDATA[jgreen1024]]></name></author>
<updated>2015-01-02T02:01:44+01:00</updated>
<published>2015-01-02T02:01:44+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=1694&amp;p=6650#p6650</id>
<link href="https://forum.yubico.com/viewtopic.php?t=1694&amp;p=6650#p6650"/>
<title type="html"><![CDATA[[QUESTION] Digital signatures]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=1694&amp;p=6650#p6650"><![CDATA[
I'm just getting started with Yubikey, and with smart cards in general, so this might be a dumb question.  I am trying to perform what should be a simple operation:  digitally sign something using the Yubikey, and then verify the signature using OpenSSL.<br /><br />I have generated an ECDSA-256 certificate request in slot 9a, issued the certificate, and installed it.  I am then generating a digital signature for a file using:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">#pkcs11-tool --module /usr/lib/i386-linux-gnu/opensc-pkcs11.so --sign --input-file=Downloads/test_file --output-file=test_file.sig<br />Using slot 1 with a present token (0x1)<br />Logging in to &quot;PIV_II (PIV Card Holder pin)&quot;.<br />Please enter User PIN: <br />Using signature algorithm ECDSA<br />Writing OpenSSL ECDSA_SIG</div><br /><br />So far, so good.  This generated a file with a length of 70 bytes.<br /><br />Now I try to verify the signature using OpenSSL.  I have extracted the public key for my certificate into the file &quot;yubikey.pubkey&quot; previously:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">#openssl dgst -verify yubikey.pubkey -signature test_file.sig test_file<br />Verification Failure</div><br /><br />Am I way off the mark in what I'm trying to do here?  Any ideas?  Thanks!<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=3427">jgreen1024</a> — Fri Jan 02, 2015 2:01 am</p><hr />
]]></content>
</entry>
</feed>