We all know that passwords/credentials in Java shall be stored as char array. Its mitigation, not protection.
I always keep my credentials not using immutable objects but soon or later I need to pass it to some class that expects String (from all the 3rd libraries we use). Isn't all the effort gone then? For example: if I want to set authorization header, the header value is stored as String by org.apache.http.message.BasicHeader class. Another example (may be not that good): I use a service that deals with passwords (stores them or something else). It requires them as body in the POST request. I create HttpPost and add StringEntity as body. Its already stored as String and can be dumped again.
Do you manage to keep your credentials relatively safe from memory dumps?
Thanks
After contacting some security experts in the field, I got the following answer: