this is adapted version of java.lang.String
this is adapted version of java.lang.String
Erases secret characters stored in this instance so that they are no longer reside in memory.
Extracts secret characters as an array.
Returns true if the string doesn't have characters.
Returns unsecured String with secret characters.
Returns unsecured String with secret characters. The secret characters are copied to the new String instance and cannot be erased in memory. So they leak to GC and may remain in memory until overwritten by new data. Usage of this method is discouraged and the method is provided solely to interact with legacy code which keeps secret characters in String.
Encapsulates secret array of characters (char[]) with proper equality. The secret data can be erased in memory and not leaked to GC. Note that calling any methods after
erase()
will throw a runtime exception. Using this class is more secure and safe than using char[] directly.Secret data, should not be copied outside of this instance. Use static methods to construct new instances.