-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the openpgp app suitable for the YubiKey NEO
add documentation for building it with eclipse-jcde make it compatible with jcop 2.4.2r1 add gpshell script for loading to card
- Loading branch information
Showing
10 changed files
with
185 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="JCDK2.2.2"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin/ | ||
src/openpgpcard/javacard/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> | ||
<properties> | ||
<comment>Java Card project properties</comment> | ||
<entry key="openpgpcard">0xD2:0x76:0x00:0x01:0x24:0x01</entry> | ||
<entry key="openpgpcard.OpenPGPApplet">0xD2:0x76:0x00:0x01:0x24:0x01:0x02:0x00:0x00:0x00:0x00:0x00:0x00:0x01:0x00:0x00</entry> | ||
</properties> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>ykneo-openpgp</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipsejcde.core.javacardBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipsejcde.core.javacardNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.5 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
YubiKey NEO App: OpenPGP | ||
======================== | ||
|
||
This project implement the OpenPGP card functionality used on the | ||
YubiKey NEO device that is sold by Yubico. This project is relatively | ||
unmodified from the upstream project on which this project is based: | ||
|
||
http://sourceforge.net/p/javacardopenpgp/ | ||
Author: Joeri de Ruiter | ||
|
||
The initial modifications we have made compared to the upstream | ||
project are minor, but we reserve the right to make other | ||
changes/improvements that are specific to the YubiKey NEO hardware. | ||
|
||
License | ||
------- | ||
|
||
The upstream project was released under the GPLv2+ and our fork uses | ||
the same license. All of our changes are released under the same | ||
license. See the file LICENSE for more information. | ||
|
||
Building | ||
-------- | ||
|
||
It is possible to build the project using proprietary NXP Java Card | ||
tools. | ||
|
||
Another way to build the project is with Eclipse and eclipse-jcde. | ||
|
||
First install Eclipse following instructions on: | ||
|
||
http://www.eclipse.org/ | ||
|
||
On Debian/Ubuntu systems Eclipse is packaged and can be installed from | ||
the command line: | ||
|
||
apt-get install eclipse | ||
|
||
Start Eclipse once to make sure it creates a $HOME/.eclipse/ | ||
directory. Then quit Eclipse. | ||
|
||
Download the eclipse-jcde-0.2.zip file from | ||
|
||
http://eclipse-jcde.sourceforge.net/ | ||
|
||
and unpack it like this: | ||
|
||
$ cd ~/.eclipse/*/ | ||
$ unzip /path/to/eclipse-jcde-0.2.zip | ||
|
||
The path to unpack the file into depends on your Eclipse installation, | ||
on my Debien Wheezy system the directory was called | ||
~/.eclipse/org.eclipse.platform_3.8_155965261/ | ||
|
||
Start Eclipse again and confirm that you have a new top-level menu | ||
called "Java Card". | ||
|
||
You then need to install the Java Card Development Kit version 2.2.2, | ||
download it from: | ||
|
||
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javame-419430.html#java_card_kit-2.2.2-oth-JPR | ||
|
||
Unpack it into a new directory called for example "jckit" like this: | ||
|
||
$ mkdir jckit | ||
$ cd jckit | ||
$ unzip /path/to/java_card_kit-2_2_2-linux.zip | ||
$ cd java_card_kit-2_2_2/ | ||
$ unzip java_card_kit-2_2_2-rr-bin-linux-do.zip | ||
|
||
Then in Eclipse select the "Preferences" menu under "Java Card" and | ||
point the "Java Card Home" directory to | ||
/path/to/jckit/java_card_kit-2_2_2 replacing /path/to as appropriate. | ||
|
||
After that the project can be imported into the workspace. | ||
Right-click in the "Project Explorer" window and select "Import". | ||
Under "General" select "Existing Projects into Workspace". As the | ||
root directory point the directory holding this file. You need to | ||
select "Copy projects into workspace". | ||
|
||
To build the .cap file, expand and right click on the "openpgpcard" | ||
sub-directory and select "Java Card Tools" and then "Convert". The | ||
CAP file will be available in your Eclipse workspace as: | ||
|
||
javacardopenpgp/bin/openpgpcard/javacard/openpgpcard.cap | ||
|
||
For loading the applet onto the card first make sure the YubiKey NEO | ||
is in the HID/CCID or CCID mode, using ykpers from the YubiKey | ||
Personalization tool: | ||
|
||
http://code.google.com/p/yubikey-personalization/ | ||
https://github.com/Yubico/yubikey-personalization | ||
|
||
For example: | ||
|
||
sudo ykpersonalize -m82 | ||
|
||
Then install the gpshell tool from Global Platform: | ||
|
||
http://sourceforge.net/projects/globalplatform/ | ||
|
||
The projects that are needed is the GlobalPlatform Library 6.0.0, | ||
GPShell 1.4.4, and gppcscconnectionplugin which doesn't seem to be | ||
available in any released tarball so you have to get it from | ||
Subversion. | ||
|
||
You need to whitelist the device in /etc/libccid_Info.plist. | ||
|
||
When the CAP file has been built and is available in the path shown | ||
above, you may use the gpshell tool to load it: | ||
|
||
$ gpshell gpinstall.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
mode_211 | ||
enable_trace | ||
|
||
establish_context | ||
card_connect | ||
select -AID a000000003000000 | ||
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f | ||
|
||
delete -AID D2760001240102000000000000010000 | ||
delete -AID D27600012401 | ||
|
||
install -file ./bin/openpgpcard/javacard/openpgpcard.cap -instParam 00 -priv 00 | ||
card_disconnect | ||
release_context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters