use unified SDK

This commit is contained in:
Michele Balistreri 2018-12-11 11:42:17 +03:00
parent 8b9fe48932
commit 245e26730d
2 changed files with 5 additions and 10 deletions

View File

@ -41,7 +41,8 @@ dependencies {
testCompile(files("../jcardsim/jcardsim-3.0.5-SNAPSHOT.jar")) testCompile(files("../jcardsim/jcardsim-3.0.5-SNAPSHOT.jar"))
testCompile('org.web3j:core:2.3.1') testCompile('org.web3j:core:2.3.1')
testCompile('org.bitcoinj:bitcoinj-core:0.14.5') testCompile('org.bitcoinj:bitcoinj-core:0.14.5')
testCompile('com.github.status-im.status-keycard-android:desktop:07b900577d') testCompile('com.github.status-im.status-keycard-android:desktop:969ae6b2b5')
testCompile('org.bouncycastle:bcprov-jdk15on:1.60')
testCompile("org.junit.jupiter:junit-jupiter-api:5.1.1") testCompile("org.junit.jupiter:junit-jupiter-api:5.1.1")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.1.1") testRuntime("org.junit.jupiter:junit-jupiter-engine:5.1.1")
} }

View File

@ -27,7 +27,6 @@ import org.web3j.utils.Convert;
import org.web3j.utils.Numeric; import org.web3j.utils.Numeric;
import javax.smartcardio.*; import javax.smartcardio.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@ -39,7 +38,7 @@ import java.nio.ByteOrder;
import java.security.KeyPair; import java.security.KeyPair;
import java.security.KeyPairGenerator; import java.security.KeyPairGenerator;
import java.security.Signature; import java.security.Signature;
import java.security.interfaces.ECPublicKey; import org.bouncycastle.jce.interfaces.ECPublicKey;
import java.util.Arrays; import java.util.Arrays;
import java.util.Random; import java.util.Random;
@ -1430,13 +1429,8 @@ public class KeycardTest {
return new Sign.SignatureData(v, rB, sB); return new Sign.SignatureData(v, rB, sB);
} }
private void verifyKeyUID(byte[] keyUID, ECPublicKey pubKey) throws Exception { private void verifyKeyUID(byte[] keyUID, ECPublicKey pubKey) {
ByteArrayOutputStream bos = new ByteArrayOutputStream(); verifyKeyUID(keyUID, pubKey.getQ().getEncoded(false));
bos.write(0x04);
bos.write(pubKey.getW().getAffineX().toByteArray());
bos.write(pubKey.getW().getAffineY().toByteArray());
verifyKeyUID(keyUID, bos.toByteArray());
} }
private void verifyKeyUID(byte[] keyUID, byte[] pubKey) { private void verifyKeyUID(byte[] keyUID, byte[] pubKey) {