java.lang.Object
com.inductiveautomation.ignition.common.script.builtin.SecretsUtilities

public class SecretsUtilities extends Object
Class for secret utilities, providing methods to interact with secret providers and secrets.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    decrypt(org.python.core.PyObject json)
    Decrypts a JSON representation of an encrypted string or byte array back to its original form using the system encryption service.
    org.python.core.PyObject
    encrypt(byte[] bytes)
    Encrypts a byte array using the system encryption service.
    org.python.core.PyObject
    encrypt(String string)
    Encrypts a string using the system encryption service.
    org.python.core.PyObject
    encrypt(String string, String charset)
    Encrypts a string using the specified charset with the system encryption service.
    List<org.python.core.PyStringMap>
    Returns a list of available secret providers.
    List<org.python.core.PyStringMap>
    getSecrets(String providerName)
    Retrieves a list of secrets from the specified provider.
    readSecretValue(String providerName, String secretName)
    Reads the value of a secret from the specified provider.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SecretsUtilities

      public SecretsUtilities(SecretsRpc rpc)
  • Method Details

    • getProviders

      public List<org.python.core.PyStringMap> getProviders()
      Returns a list of available secret providers.
      Returns:
      a list of dictionaries, each containing 'name', 'description', and 'type' of a secret provider.
    • getSecrets

      public List<org.python.core.PyStringMap> getSecrets(String providerName)
      Retrieves a list of secrets from the specified provider.
      Parameters:
      providerName - the name of the secret provider.
      Returns:
      a list of dictionaries, each containing 'name' of a secret.
    • readSecretValue

      public PyPlaintext readSecretValue(String providerName, String secretName)
      Reads the value of a secret from the specified provider.
      Parameters:
      providerName - the name of the secret provider.
      secretName - the name of the secret to read.
      Returns:
      a PyPlaintext object containing the secret value.
    • encrypt

      public org.python.core.PyObject encrypt(String string)
      Encrypts a string using the system encryption service.
      Parameters:
      string - the string to encrypt.
      Returns:
      a JSON representation of the encrypted string.
    • encrypt

      public org.python.core.PyObject encrypt(String string, String charset)
      Encrypts a string using the specified charset with the system encryption service.
      Parameters:
      string - the string to encrypt.
      charset - the charset to use for encoding the string.
      Returns:
      a JSON representation of the encrypted string.
    • encrypt

      public org.python.core.PyObject encrypt(byte[] bytes)
      Encrypts a byte array using the system encryption service.
      Parameters:
      bytes - the byte array to encrypt.
      Returns:
      a JSON representation of the encrypted byte array.
    • decrypt

      public PyPlaintext decrypt(org.python.core.PyObject json)
      Decrypts a JSON representation of an encrypted string or byte array back to its original form using the system encryption service.
      Parameters:
      json - the JSON representation of the encrypted data.
      Returns:
      a PyPlaintext object containing the decrypted value.