rename to keycard

This commit is contained in:
Michele Balistreri 2018-12-04 09:53:43 +03:00
parent 482e32c5b7
commit d56b0c432e
5 changed files with 11 additions and 11 deletions

View File

@ -1,2 +1,2 @@
# hardwallet-lite-sdk
SDK for the Hardwallet Lite. Work in progress.
# Keycard Desktop SDK
Java Desktop SDK for the Keycard. WIP, will share code with the Android SDK

View File

@ -1,2 +1,2 @@
rootProject.name = 'im.status.hardwallet-lite-sdk'
rootProject.name = 'im.status.keycard.desktop'

View File

@ -1,10 +1,10 @@
import im.status.hardwallet.lite.WalletAppletCommandSet;
import im.status.keycard.KeycardCommandSet;
import org.bouncycastle.util.encoders.Hex;
import javax.smartcardio.*;
import java.security.Security;
import static im.status.hardwallet.lite.WalletAppletCommandSet.checkOK;
import static im.status.keycard.KeycardCommandSet.checkOK;
public class Main {
public static void main(String[] args) throws Exception {
@ -32,7 +32,7 @@ public class Main {
CardChannel apduChannel = apduCard.getBasicChannel();
// Applet-specific code
WalletAppletCommandSet cmdSet = new WalletAppletCommandSet(apduChannel);
KeycardCommandSet cmdSet = new KeycardCommandSet(apduChannel);
// First thing to do is selecting the applet on the card.
checkOK(cmdSet.select());
@ -44,7 +44,7 @@ public class Main {
cmdSet.autoOpenSecureChannel();
// We send a GET STATUS command, which does not require PIN authentication
ResponseAPDU resp = checkOK(cmdSet.getStatus(WalletAppletCommandSet.GET_STATUS_P1_APPLICATION));
ResponseAPDU resp = checkOK(cmdSet.getStatus(KeycardCommandSet.GET_STATUS_P1_APPLICATION));
System.out.println("GET STATUS response: " + Hex.toHexString(resp.getData()));
// PIN authentication allows execution of privileged commands

View File

@ -1,4 +1,4 @@
package im.status.hardwallet.lite;
package im.status.keycard;
import org.bouncycastle.jce.interfaces.ECPrivateKey;
import org.bouncycastle.jce.interfaces.ECPublicKey;
@ -20,7 +20,7 @@ import java.util.Arrays;
* file. Some APDUs map to multiple methods for the sake of convenience since their payload or response require some
* pre/post processing.
*/
public class WalletAppletCommandSet {
public class KeycardCommandSet {
static final byte INS_INIT = (byte) 0xFE;
static final byte INS_GET_STATUS = (byte) 0xF2;
static final byte INS_SET_NDEF = (byte) 0xF3;
@ -79,7 +79,7 @@ public class WalletAppletCommandSet {
return resp;
}
public WalletAppletCommandSet(CardChannel apduChannel) {
public KeycardCommandSet(CardChannel apduChannel) {
this.apduChannel = apduChannel;
this.secureChannel = new SecureChannelSession();
}

View File

@ -1,4 +1,4 @@
package im.status.hardwallet.lite;
package im.status.keycard;
import org.bouncycastle.crypto.engines.AESEngine;
import org.bouncycastle.crypto.macs.CBCBlockCipherMac;