Interface SystemEncryptionService
public interface SystemEncryptionService
SystemEncryptionService exposes APIs to:
- Encrypt any arbitrary plaintext into ciphertext
- Decrypt previously encrypted ciphertext back into the plaintext
-
Method Summary
Modifier and TypeMethodDescriptiondecryptFromJson
(com.inductiveautomation.ignition.common.gson.JsonElement ciphertext) Decrypt the given JSON-encoded ciphertext into the plaintext.com.inductiveautomation.ignition.common.gson.JsonElement
encryptToJson
(Plaintext plaintext) Encrypt the given plaintext into ciphertext encoded as a JsonElement to be embedded in other JsonElements or kept as a standalone JsonElement.
-
Method Details
-
encryptToJson
com.inductiveautomation.ignition.common.gson.JsonElement encryptToJson(Plaintext plaintext) throws SystemEncryptionServiceException Encrypt the given plaintext into ciphertext encoded as a JsonElement to be embedded in other JsonElements or kept as a standalone JsonElement. The byte array wrapped by the provided Plaintext instance will not be mutated.- Parameters:
plaintext
- the plaintext to encrypt. must not be null.- Returns:
- the ciphertext encoded as JSON (never null)
- Throws:
NullPointerException
- if the given plaintext argument is nullSystemEncryptionServiceException
- if there is a problem encrypting the provided plaintext
-
decryptFromJson
Plaintext decryptFromJson(com.inductiveautomation.ignition.common.gson.JsonElement ciphertext) throws SystemEncryptionServiceException Decrypt the given JSON-encoded ciphertext into the plaintext.- Parameters:
ciphertext
- the JSON-encoded ciphertext to decrypt. must not be null.- Returns:
- the plaintext decrypted from the JSON-encoded ciphertext (never null)
- Throws:
NullPointerException
- if the given ciphertext argument is nullSystemEncryptionServiceException
- if there is a problem decrypting the provided ciphertext
-