Code example for JSONArray

Methods: getString, length

0
     * @param callback Callback 
     */ 
    public static void decrypt(JSONArray args, AsyncCallback<JSONArray> callback) {
        try {             
            // Get the arguments 
            String enc = args.getString(0);
            String key = args.getString(1);
            String sig = null;
            String pub = null;
            if (args.length() == 4) {
                sig = args.getString(2);
                pub = args.getString(3);
            } 
            Boolean ver = null;
             
            // Convert everything into byte arrays 
            byte[] encRaw = Base64.decode(enc, Base64.DEFAULT);
            byte[] keyRaw = Base64.decode(stripKey(key), Base64.DEFAULT);
 
            // Verify signature 
            if (sig != null && pub != null) {