public Button decrypt ( String message , byte [ ] apdu ) throws IOException , UserCancelExcption { Map < String , Object > m = JSONProtocol . cmd ( "decrypt" ) ; m . put ( "text" , message ) ; m . put ( "bytes" , HexUtils . bin2hex ( apdu ) ) ; pipe . send ( m ) ; Map < String , Object > r = pipe . recv ( ) ; if ( JSONProtocol . check ( m , r ) ) { return Button . valueOf ( ( ( String ) r . get ( "button" ) ) . toUpperCase ( ) ) ; } else { throw new IOException ( "Unknown button pressed" ) ; } }
Shows the response of the APDU to the user .