public interface SecretsRpc
  • Method Summary

    Modifier and Type
    Method
    Description
    decryptFromJson(com.inductiveautomation.ignition.common.gson.JsonElement json)
    Decrypts a JSON representation of a Plaintext object back to its original Plaintext form using the system encryption service.
    com.inductiveautomation.ignition.common.gson.JsonElement
    Encrypts a Plaintext object to a JSON representation using the system encryption service.
    Returns a list of available secret providers.
    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.
  • Method Details

    • getProviders

      List<SecretProviderMeta> getProviders()
      Returns a list of available secret providers.
      Returns:
      a list of SecretProviderMeta objects representing the available secret providers.
    • getSecrets

      List<SecretMeta> getSecrets(String providerName) throws SecretProviderException
      Retrieves a list of secrets from the specified provider.
      Parameters:
      providerName - the name of the secret provider.
      Returns:
      a list of SecretMeta objects representing the secrets in the specified provider.
      Throws:
      SecretProviderException - If the specified provider does not exist, or if an error occurs while interacting with the secret provider.
      UnsupportedOperationException - If the specified provider does not support listing secrets.
    • readSecretValue

      Plaintext readSecretValue(String providerName, String secretName) throws SecretProviderException
      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 Plaintext instance that contains the secret value.
      Throws:
      NullPointerException - If the secretName is null.
      SecretNotFoundException - If the specified secret does not exist.
      SecretProviderException - If the specified provider does not exist, or if an error occurs while interacting with the secret provider.
    • encryptToJson

      com.inductiveautomation.ignition.common.gson.JsonElement encryptToJson(Plaintext plaintext) throws SystemEncryptionServiceException
      Encrypts a Plaintext object to a JSON representation using the system encryption service.
      Parameters:
      plaintext - the Plaintext object to encrypt.
      Returns:
      a JsonElement representing the encrypted plaintext.
      Throws:
      NullPointerException - If the given plaintext argument is null.
      SystemEncryptionServiceException - If there is a problem encrypting the provided plaintext.
    • decryptFromJson

      Plaintext decryptFromJson(com.inductiveautomation.ignition.common.gson.JsonElement json) throws SystemEncryptionServiceException
      Decrypts a JSON representation of a Plaintext object back to its original Plaintext form using the system encryption service.
      Parameters:
      json - the JsonElement representing the encrypted plaintext.
      Returns:
      a Plaintext object containing the decrypted value.
      Throws:
      NullPointerException - If the given ciphertext argument is null.
      SystemEncryptionServiceException - If there is a problem decrypting the provided ciphertext.