Retrieve a property by providing additional parameters

Hi,
I am using WebThings Java framework. My scenario is that I want to allow users to access a “property” encrypted with a user-defined password. I managed to implement this functionality using the approach I describe at the end of the message. So my question is if this approach sounds correct. If it sounds OK I can push my code to a github repository in case others want to implement similar scenarios. So my approach is the following:

I added to the Thing object an “Action” which accepts as input a string representing the encryption key. In the class that implements the Action I overrided the asActionDescription() method as follows:

@Override
public JSONObject asActionDescription() {
JSONObject obj = super.asActionDescription();
// Here it should be checked if obj is null
obj.getJSONObject("").put(“output”, “This is an output”);
return obj;
}

Any comments?