java.lang.Object
org.forgerock.openam.scripting.api.secrets.Secret

@SupportedAll(scriptingApi=true) public class Secret extends Object
Value object that models a secret as a value. This can be represented to the caller in either StandardCharsets.UTF_8 or in the underlying byte[] form depending on what the secret is. The caller is responsible for determining how to interpret the contained data.
  • Constructor Details

    • Secret

      public Secret(@Nonnull GenericSecret genericSecret)
      Default constructor exposing required dependencies.
      Parameters:
      genericSecret - Non null.
  • Method Details

    • getAsUtf8

      public String getAsUtf8()
      Provide a StandardCharsets.UTF_8 rendering of the GenericSecret.
      Returns:
      Non null String representation of the secret.
    • getAsBytes

      public byte[] getAsBytes()
      Access the secret value in byte form.
      Returns:
      The byte[] representation of the secret.