public 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.
EncryptedTextDataType
Modifier and Type | Method and Description |
---|---|
java.lang.String |
decrypt(TypedValue encryptedText)
Decrypts an
AppianType.ENCRYPTED_TEXT value. |
java.lang.String |
decryptFromString(java.lang.String myCypherText) |
TypedValue |
encrypt(java.lang.String plaintext)
Encrypts a plaintext string into a
TypedValue of type AppianType.ENCRYPTED_TEXT . |
java.lang.String |
encryptToString(java.lang.String plaintext) |
TypedValue encrypt(java.lang.String plaintext) throws EncryptionException
TypedValue
of type AppianType.ENCRYPTED_TEXT
.plaintext
- plaintext string to encryptEncryptionException
- if the system cannot encrypt the given textjava.lang.String encryptToString(java.lang.String plaintext) throws EncryptionException
plaintext
- plaintext string to encryptEncryptionException
- if the system cannot encrypt the given textjava.lang.String decrypt(TypedValue encryptedText) throws DecryptionException
AppianType.ENCRYPTED_TEXT
value.encryptedText
- encrypted value to decryptDecryptionException
- if decryption fails or if the encryptedText typed value is not of type
AppianType.ENCRYPTED_TEXT
java.lang.String decryptFromString(java.lang.String myCypherText) throws DecryptionException
myCypherText
- encrypted string to decryptDecryptionException
- if decryption failsCopyright © 2003-2024 Appian Corporation. All Rights Reserved.