Back to project page irma_android_cardproxy.
The source code is released under:
GNU General Public License
If you think the Android project irma_android_cardproxy listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.irmacard.androidcardproxy; //from w w w .j a v a 2s .c om import java.lang.reflect.Type; import net.sourceforge.scuba.smartcards.ProtocolResponse; import net.sourceforge.scuba.util.Hex; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; /** * Helper class to serialize ProtocolResponse to JSON. * */ public class ProtocolResponseSerializer implements JsonSerializer<ProtocolResponse> { @Override public JsonElement serialize(ProtocolResponse src, Type typeOfSrc, JsonSerializationContext context) { JsonObject obj = new JsonObject(); obj.addProperty("key", src.getKey()); obj.addProperty("apdu", Hex.bytesToHexString(src.getAPDU().getBytes())); return obj; } }