* Returns a JSONObject representation of the instruction object.
* @deprecated no longer used and will be removed in the future
*/
@Deprecated
private static JSONObject convertInstructionToJSONObject(EncryptionInstruction instruction) {
JSONObject instructionJSON = new JSONObject();
try {
JSONObject materialsDescriptionJSON = new JSONObject(
instruction.getMaterialsDescription());
instructionJSON.put(Headers.MATERIALS_DESCRIPTION,
materialsDescriptionJSON.toString());
instructionJSON.put(Headers.CRYPTO_KEY,
Base64.encodeAsString(instruction.getEncryptedSymmetricKey()));
byte[] iv = instruction.getSymmetricCipher().getIV();
instructionJSON.put(Headers.CRYPTO_IV, Base64.encodeAsString(iv));
} catch (JSONException e) {} // Keys are never null, so JSONException will never be thrown.