Class Secret
- java.lang.Object
-
- org.forgerock.openam.scripting.api.secrets.Secret
-
@SupportedAll public class Secret extends Object
Value object that models a secret as a value. This can be represented to the caller in eitherStandardCharsets.UTF_8
or in the underlyingbyte[]
form depending on what the secret is. The caller is responsible for determining how to interpret the contained data.
-
-
Constructor Summary
Constructors Constructor Description Secret(GenericSecret genericSecret)
Default constructor exposing required dependencies.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getAsBytes()
Access the secret value inbyte
form.String
getAsUtf8()
Provide aStandardCharsets.UTF_8
rendering of theGenericSecret
.
-
-
-
Constructor Detail
-
Secret
public Secret(@Nonnull GenericSecret genericSecret)
Default constructor exposing required dependencies.- Parameters:
genericSecret
- Non null.
-
-
Method Detail
-
getAsUtf8
public String getAsUtf8()
Provide aStandardCharsets.UTF_8
rendering of theGenericSecret
.- Returns:
- Non null String representation of the secret.
-
getAsBytes
public byte[] getAsBytes()
Access the secret value inbyte
form.- Returns:
- The
byte[]
representation of the secret.
-
-