Class SecretsUtilities
java.lang.Object
com.inductiveautomation.ignition.common.script.builtin.SecretsUtilities
Class for secret utilities, providing methods to interact with secret providers and secrets.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecrypt(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.PyObjectencrypt(byte[] bytes) Encrypts a byte array using the system encryption service.org.python.core.PyObjectEncrypts a string using the system encryption service.org.python.core.PyObjectEncrypts 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.
-
Constructor Details
-
SecretsUtilities
-
-
Method Details
-
getProviders
Returns a list of available secret providers.- Returns:
- a list of dictionaries, each containing 'name', 'description', and 'type' of a secret provider.
-
getSecrets
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
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
PyPlaintextobject containing the secret value.
-
encrypt
Encrypts a string using the system encryption service.- Parameters:
string- the string to encrypt.- Returns:
- a JSON representation of the encrypted string.
-
encrypt
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
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
PyPlaintextobject containing the decrypted value.
-