public class ScopedKeys
extends java.lang.Object
Example usage:
String apiKey = "YOUR_API_KEY_HERE";
//Filters to apply to the key
Map<String, Object> filter = new HashMap<String, Object>();
List<Map<String, Object>> filters = new ArrayList<Map<String, Object>>();
//Create and add a filter
filter.put("property_name", "user_id");
filter.put("operator", "eq");
filter.put("property_value", "123");
filters.add(filter);
// create the options we'll use
Map<String, Object> options = new HashMap<String, Object>();
options.put("allowed_operations", Arrays.asList("write"));
options.put("filters", filters);
// do the encryption
String scopedKey = ScopedKeys.encrypt(apiKey, options);
| Constructor and Description |
|---|
ScopedKeys() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
decrypt(KeenClient client,
java.lang.String apiKey,
java.lang.String scopedKey)
Decrypts the given Keen IO Scoped Key with an API Key and returns the decrypted Scoped Key Options.
|
static java.util.Map<java.lang.String,java.lang.Object> |
decrypt(java.lang.String apiKey,
java.lang.String scopedKey)
Decrypts the given Keen IO Scoped Key with an API Key and returns the decrypted Scoped Key Options.
|
static java.util.Map<java.lang.String,java.lang.Object> |
decrypt32CharacterKey(KeenClient client,
java.lang.String apiKey,
java.lang.String scopedKey)
Decrypts the given Keen IO Scoped Key with an API Key and returns the decrypted Scoped Key Options.
|
static java.lang.String |
encrypt(KeenClient client,
java.lang.String apiKey,
java.util.Map<java.lang.String,java.lang.Object> options)
Encrypts the given options with a Keen IO API Key and creates a Scoped Key.
|
static java.lang.String |
encrypt(java.lang.String apiKey,
java.util.Map<java.lang.String,java.lang.Object> options)
Encrypts the given options with a Keen IO API Key and creates a Scoped Key.
|
static java.lang.String |
encrypt32CharacterKey(KeenClient client,
java.lang.String apiKey,
java.util.Map<java.lang.String,java.lang.Object> options)
Encrypts the given options with a Keen IO API Key and creates a Scoped Key.
|
public static java.lang.String encrypt(java.lang.String apiKey,
java.util.Map<java.lang.String,java.lang.Object> options)
throws ScopedKeyException
apiKey - Your Keen IO API Key.options - The options you want to encrypt.ScopedKeyException - an error occurred while attempting to encrypt a Scoped Key.public static java.lang.String encrypt(KeenClient client, java.lang.String apiKey, java.util.Map<java.lang.String,java.lang.Object> options) throws ScopedKeyException
client - The KeenClient to use for JSON handling.apiKey - Your Keen IO API Key.options - The options you want to encrypt.ScopedKeyException - an error occurred while attempting to encrypt a Scoped Key.public static java.lang.String encrypt32CharacterKey(KeenClient client, java.lang.String apiKey, java.util.Map<java.lang.String,java.lang.Object> options) throws ScopedKeyException
client - The KeenClient to use for JSON handling.apiKey - Your Keen IO API Key.options - The options you want to encrypt.ScopedKeyException - an error occurred while attempting to encrypt a Scoped Key.public static java.util.Map<java.lang.String,java.lang.Object> decrypt(java.lang.String apiKey,
java.lang.String scopedKey)
throws ScopedKeyException
apiKey - Your Keen IO API Key.scopedKey - The Scoped Key you want to decrypt.ScopedKeyException - an error occurred while attempting to decrypt a Scoped Key.public static java.util.Map<java.lang.String,java.lang.Object> decrypt(KeenClient client, java.lang.String apiKey, java.lang.String scopedKey) throws ScopedKeyException
client - The KeenClient to use for JSON handling.apiKey - Your Keen IO API Key.scopedKey - The Scoped Key you want to decrypt.ScopedKeyException - an error occurred while attempting to decrypt a Scoped Key.public static java.util.Map<java.lang.String,java.lang.Object> decrypt32CharacterKey(KeenClient client, java.lang.String apiKey, java.lang.String scopedKey) throws ScopedKeyException
client - The KeenClient to use for JSON handling.apiKey - Your Keen IO API Key.scopedKey - The Scoped Key you want to decrypt.ScopedKeyException - an error occurred while attempting to decrypt a Scoped Key.