ScopedKeys { public static String encrypt(String apiKey, Map<String, Object> options) throws ScopedKeyException { if (apiKey.length() == 64) { return encrypt(KeenClient.client(), apiKey, options); } else { return encrypt32CharacterKey(KeenClient.client(), apiKey, options); } }  static String encrypt(String apiKey, Map<String, Object> options); static String encrypt(KeenClient client, String apiKey, Map<String, Object> options); static String encrypt32CharacterKey(KeenClient client, String apiKey, Map<String, Object> options); static Map<String, Object> decrypt(String apiKey, String scopedKey); static Map<String, Object> decrypt(KeenClient client, String apiKey, String scopedKey); static Map<String, Object> decrypt32CharacterKey(KeenClient client, String apiKey, String scopedKey);  }
@Test public void testSampleCode() { String apiKey = "YOUR_API_KEY_HERE"; Map<String, Object> filter = new HashMap<String, Object>(); List<Map<String, Object>> filters = new ArrayList<Map<String, Object>>(); filter.put("property_name", "user_id"); filter.put("operator", "eq"); filter.put("property_value", "123"); filters.add(filter); Map<String, Object> options = new HashMap<String, Object>(); options.put("allowed_operations", Arrays.asList("write")); options.put("filters", filters); String scopedKey = ScopedKeys.encrypt(apiKey, options); }