Because QR code needs to have white background and a margin:
feh --image-bg "#FFFFFF" -g 320x320 florence_idpass.png
diff --git a/src/test/java/io/mosip/print/mosip_print/DemoApplicationTests.java b/src/test/java/io/mosip/print/mosip_print/DemoApplicationTests.java | |
index 73bd735..87e8f4c 100644 | |
--- a/src/test/java/io/mosip/print/mosip_print/DemoApplicationTests.java | |
+++ b/src/test/java/io/mosip/print/mosip_print/DemoApplicationTests.java | |
@@ -1,13 +1,13 @@ | |
package io.mosip.print.mosip_print; | |
-import org.junit.jupiter.api.Test; | |
+import org.junit.Test; | |
import org.springframework.boot.test.context.SpringBootTest; |
@Test | |
public void test_verify_florence_id() throws IDPassException, IOException, NotFoundException { | |
// Initialize reader | |
IDPassReader reader = new IDPassReader("alias0","demokeys.cfg.p12","changeit"); | |
File qrcodeId = new File(String.valueOf(Paths.get("florence_idpass.png"))); | |
BufferedImage bufferedImage = ImageIO.read(qrcodeId); | |
// Read the QR code image | |
Card cardOriginal = reader.open(bufferedImage); |
public IDPassReader(String alias, String configfile, String keystorePass) | |
throws IDPassException, IOException { | |
byte[] cfg = IDPassHelper.readKeyStoreEntry(alias, configfile, keystorePass); | |
byteArrays bas = byteArrays.parseFrom(cfg); | |
byteArray ba0 = bas.getVals(0); // keyset buf | |
byteArray ba1 = bas.getVals(1); // rootcertificates buf | |
byteArray ba2 = bas.getVals(2); // rootkey buf | |
m_keyset = KeySet.parseFrom(ba0.getVal().toByteArray()); |
public boolean saveConfiguration(String alias, String keystorefile, String keystorePass) | |
{ | |
byteArray ba1 = byteArray.newBuilder().setVal(ByteString.copyFrom(m_keyset.toByteArray())).build(); | |
byteArray ba2 = byteArray.newBuilder().setVal(ByteString.copyFrom(m_rootcertificates.toByteArray())).build(); | |
byteArray ba3 = byteArray.newBuilder().setVal(ByteString.copyFrom(m_rootkey)).build(); | |
byteArrays bas = byteArrays.newBuilder() | |
.addVals(ba1) | |
.addVals(ba2) | |
.addVals(ba3) |
@Test | |
public void test_jgenerate_florence_id() throws IDPassException, IOException { | |
byte[] photo = Files.readAllBytes(Paths.get("testdata/florence_ID_Photo.jpg")); | |
Ident ident = Ident.newBuilder() | |
.setPhoto(ByteString.copyFrom(photo)) | |
.setGivenName("MARION FLORENCE") | |
.setSurName("DUPONT") | |
.setPin("1234") |
@Test | |
public void test_generate_florence_id() throws IDPassException, IOException { | |
byte[] photo = Files.readAllBytes(Paths.get("testdata/florence.jpg")); | |
Ident ident = Ident.newBuilder() | |
.setPhoto(ByteString.copyFrom(photo)) | |
.setGivenName("MARION FLORENCE") | |
.setSurName("DUPONT") | |
.setPin("1234") |
Because QR code needs to have white background and a margin:
feh --image-bg "#FFFFFF" -g 320x320 florence_idpass.png
$ java -jar target/idpass-lite-rest-0.0.1-SNAPSHOT.jar | |
Exception getting JarFile object: file:/home/dx/src/my/idpass-lite-rest/target/idpass-lite-rest-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/idpass-lite-mosip-1.0.0.jar! | |
Exception in thread "main" java.lang.reflect.InvocationTargetException | |
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | |
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.base/java.lang.reflect.Method.invoke(Method.java:566) | |
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) | |
at org.springframework.boot.loader.Launcher.launch(Launcher.java:109) | |
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) |
accessors-smart-1.2.jar | |
aether-api-1.7.jar | |
aether-impl-1.7.jar | |
aether-spi-1.7.jar | |
aether-util-1.7.jar | |
android-json-0.0.20131108.vaadin1.jar | |
apiguardian-api-1.0.0.jar | |
apiguardian-api-1.1.0.jar | |
asm-5.0.4.jar | |
asm-6.2.jar |