The contextName in the above call must n to be null. To map to the default context use: new OctetString() instead.
The mask value in the above call must not be null (a null value will cause a NullPointerException during request processing and will not authorise the request).
Sorry Frank I was not making myself clear. What I meant was using java code to add security so I can avoid some of the restrictions like what I shouldn’t use etc.
Also, is it safe to say that if we don’t have data, we should be using new OctetString() instead of passing in null?
For MIB data, you always have to provide a SMI Variable value (null is not allowed). This is true for all MIB modules, because SNMP does not support null values.