public final class SecureString
extends java.lang.Object
implements java.lang.CharSequence, java.io.Closeable
| Constructor and Description |
|---|
SecureString(char[] chars)
Constructs a new SecureString which controls the passed in char array.
|
SecureString(java.lang.String s)
Deprecated.
Only use for compatibility between deprecated string settings and new secure strings
|
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index) |
void |
close()
Closes the string by clearing the underlying char array.
|
boolean |
equals(java.lang.Object o)
Constant time equality to avoid potential timing attacks.
|
int |
hashCode() |
int |
length() |
SecureString |
subSequence(int start,
int end) |
java.lang.String |
toString()
Convert to a
String. |
public SecureString(char[] chars)
@Deprecated public SecureString(java.lang.String s)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int length()
length in interface java.lang.CharSequencepublic char charAt(int index)
charAt in interface java.lang.CharSequencepublic SecureString subSequence(int start, int end)
subSequence in interface java.lang.CharSequencepublic java.lang.String toString()
String. This should only be used with APIs that do not take CharSequence.toString in interface java.lang.CharSequencetoString in class java.lang.Objectpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseable