Interface EncryptionService
Service that provides the capability to encrypt plaintext values and decrypt values of type Encrypted Text.
Like other services, this service can be injected into plug-ins. In order for a plug-in to be authorized to use the `EncryptionService`, the plug-in must be granted access to it via the Plug-ins page of the Administration Console.
Do not create plug-in functions or smart services with these methods that simply take a plaintext value and return an encrypted form of it, or take an Encrypted Text value and return a decrypted form of it. Doing so will introduce the ability for designers to inadvertently expose sensitive data because the plaintext value passed to or returned from the encryption function or smart service will end up in the engine transaction logs.
Instead, use the encrypt(java.lang.String)
method to safely return a sensitive value from a function or smart
service that generates that sensitive value or retrieves it from an external source. Similarly, use the
decrypt(com.appiancorp.suiteapi.type.TypedValue)
method within a function or smart service that takes an Encrypted Text input to decrypt
the value before processing it or sending it securely to an external system.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondecrypt
(TypedValue encryptedText) Decrypts anAppianType.ENCRYPTED_TEXT
value.decryptFromString
(String myCypherText) Encrypts a plaintext string into aTypedValue
of typeAppianType.ENCRYPTED_TEXT
.encryptToString
(String plaintext)
-
Method Details
-
encrypt
Encrypts a plaintext string into aTypedValue
of typeAppianType.ENCRYPTED_TEXT
.- Parameters:
plaintext
- plaintext string to encrypt- Returns:
- EncryptedText representation of the encrypted value
- Throws:
EncryptionException
- if the system cannot encrypt the given text
-
encryptToString
- Parameters:
plaintext
- plaintext string to encrypt- Returns:
- String representation of the encrypted text
- Throws:
EncryptionException
- if the system cannot encrypt the given text
-
decrypt
Decrypts anAppianType.ENCRYPTED_TEXT
value.- Parameters:
encryptedText
- encrypted value to decrypt- Returns:
- Plaintext string representation of the decrypted value
- Throws:
DecryptionException
- if decryption fails or if the encryptedText typed value is not of typeAppianType.ENCRYPTED_TEXT
-
decryptFromString
- Parameters:
myCypherText
- encrypted string to decrypt- Returns:
- Plaintext string representation of the decrypted value
- Throws:
DecryptionException
- if decryption fails
-