public class Secret extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
addChars(char[] chars)
Adds the given character array to the existing character array of the secret
|
void |
clear()
Clears byte and character arrays of the secret.
|
byte[] |
getBytes()
Returns the secret as a byte array in UTF-8 format
|
byte[] |
getBytes(Charset charset)
Returns the secret as a byte array for the given encoding format
|
char[] |
getChars()
Returns the secret as a character array
|
static Secret |
getSecret(Object secret)
Returns an instance of a Secret for the given secret type.
|
boolean |
isEmpty()
Check if the character array of the secret is null or empty
|
void |
setChars(char[] chars)
Sets the given character array as the secret and clears the previous character array
|
public char[] getChars()
public byte[] getBytes()
public byte[] getBytes(Charset charset)
charset - Character encoding formatpublic boolean isEmpty()
public void setChars(char[] chars)
chars - character array of the secretpublic void addChars(char[] chars)
chars - character array to be addedpublic void clear()
public static Secret getSecret(Object secret) throws UnsupportedSecretTypeException
secret - given secret. Supports only Secret, char[] or a String typesUnsupportedSecretTypeException - thrown if the given secret is not either a Secret, char[] or StringCopyright © 2018 WSO2 Inc. All rights reserved.