Encryption as a Service
This feature is currently available only to customers participating in a Private Preview. If you'd like to participate and be among the first to try this feature, ask our support or account team for details.
Encryption as a service lets pipelines and applications encrypt and decrypt data with named keys that stay inside Workload Secrets Vault. Callers send plaintext and get ciphertext back, or the reverse. They never handle the key itself. Use it to protect data that you store somewhere else, such as a configuration file in a build artifact.
This topic covers keys that Workload Secrets Vault generates and manages. To use key material that you generate yourself, see Bring Your Own Key.
About Keys
-
Each key has a path, such as
payments/deploy-config. Key paths use lowercase letters, digits, hyphens, underscores, and periods, with/between segments. They can't start or end with/, can't contain empty,., or..segments, and can be up to 500 characters long. -
Each key version is a random 256-bit key. The service stores it encrypted with a key that belongs to your tenant, and the API never returns it.
-
Encryption is authenticated. If ciphertext is changed in any way, decryption fails instead of returning altered data.
-
Ciphertext is bound to your tenant and to the key's path. It can only be decrypted with the same key in the same tenant.
-
There's no command to list keys, and you can't export a key or choose its algorithm or size.
Creating a Key
delinea --json workload crypto auto key create payments/deploy-config
{
"path": "payments/deploy-config",
"version": 1,
"createdAt": "2026-11-05T17:20:44.031Z"
}
Creating a key at a path that already has one, including a deleted key that hasn't been permanently removed, fails with 409.
Encrypting Data
Pass the key path and the plaintext. The CLI sends the plaintext exactly as you give it, so quotes and line breaks in it don't need escaping:
delinea --json workload crypto auto encrypt --path payments/deploy-config \
--plaintext="$(cat app.env)" | jq -r '.ciphertext' > app.env.enc
The response contains the ciphertext, encoded in Base64, and the key version that encrypted it:
{
"version": 1,
"ciphertext": "AQEAAc3Zp1u9kPa0Qb8m...truncated...Xk2V0w=="
}
-
Plaintext is treated as UTF-8 text, and each request can encrypt up to 64 KiB, counted in UTF-8 bytes. To encrypt binary data, encode it as Base64 first and decode it after you decrypt. Base64 makes data about a third larger, so each request can carry about 48 KiB of binary data. For example,
base64 < data.bin | tr -d '\n'encodes a file without line breaks with both GNU and macOSbase64. -
Encryption always uses the key's current version.
-
Encryption as a service is meant for small payloads such as configuration files, tokens, and keys, not for bulk or file encryption.
Decrypting Data
delinea --json workload crypto auto decrypt --path payments/deploy-config \
--ciphertext "$(cat app.env.enc)" | jq -r '.plaintext' > app.env
The ciphertext records which key version encrypted it, so you don't need to specify the version. If there's no key at the path, or the key is deleted, the response is 404 with the error code crypto_key_not_found. If decryption fails for any other reason, such as altered ciphertext, the path of a different key, or a version that doesn't exist, the response is the same 400 with the error code crypto_operation_failed.
Rotating Keys and Rewrapping Ciphertext
Rotating a key creates a new version and makes it the one used for new encryptions. Ciphertext from earlier versions still decrypts.
delinea --json workload crypto auto rotate payments/deploy-config
To make sure nobody else rotated the key first, pass the version you expect to be current, for example --starting-version 1. If the key is at a different version, the rotation fails with 409.
Rewrapping re-encrypts existing ciphertext with the current key version. The plaintext never leaves the service:
ciphertext=$(cat app.env.enc)
delinea --json workload crypto auto rewrap payments/deploy-config \
--ciphertext "$ciphertext" | jq -r '.ciphertext' > app.env.enc
-
A key can have up to 9,999 versions.
-
Rotation is manual. There's no rotation schedule.
-
Earlier versions can't be disabled. Ciphertext from any version decrypts for as long as the key exists, so rewrap stored ciphertext after you rotate.
Viewing a Key
delinea --json workload crypto auto key get payments/deploy-config
The response shows the path, the current version, the list of versions, whether the key is deleted, and when it was created. It never includes key material.
Deleting and Restoring Keys
delinea workload crypto auto key delete payments/deploy-config
delinea workload crypto auto restore payments/deploy-config
-
Deleting a key affects all its versions. While the key is deleted, encrypt, decrypt, rotate, and rewrap requests return
404. -
You can restore a deleted key for 30 days. After that, it's permanently removed.
When a key is permanently removed, nothing encrypted with it can ever be decrypted again. Decrypt or rewrap anything you still need before the 30 days are up.
Permissions and Policy Actions
Policy targets for these keys have the form cryptokey/<path>. They don't cover BYOK keys.
| Operation | Permission | Policy action |
|---|---|---|
| Create a key | Create Key | create
|
| View a key | Read Key | read
|
| Encrypt | Encrypt Data | encrypt
|
| Decrypt | Decrypt Data | decrypt
|
| Rotate a key | Manage Key | rotate
|
| Rewrap ciphertext | Manage Key | rewrap
|
| Delete a key | Delete Key | delete
|
| Restore a key | Update Key | restore
|
Give encrypt and decrypt to different identities when you can. For example, a build job that only encrypts can't read what it produced, and only the deployment job can decrypt it.
REST API Reference
Paths are relative to https://<your-tenant>/workload-secrets/api/v1/. Service-managed keys use paths under crypto/auto/, and BYOK keys use paths under crypto/manual/, which are listed in REST API Reference.
| Operation | Request | CLI (delinea workload crypto auto ...) |
|---|---|---|
| Create | POST crypto/auto/keys/{path}
|
key create <path>
|
| View | GET crypto/auto/keys/{path}
|
key get <path>
|
| Delete | DELETE crypto/auto/keys/{path}
|
key delete <path>
|
| Restore | PUT crypto/auto/restore/{path}
|
restore <path>
|
| Encrypt | POST crypto/auto/encrypt with {"path", "plaintext"} |
encrypt --path <path> --plaintext <text>
|
| Decrypt | POST crypto/auto/decrypt with {"path", "ciphertext"} |
decrypt --path <path> --ciphertext <text>
|
| Rotate | POST crypto/auto/rotate/{path} with {"startingVersion"} (optional field) |
rotate <path> [--starting-version <n>]
|
| Rewrap | POST crypto/auto/rewrap/{path} with {"ciphertext"} |
rewrap <path> --ciphertext <text>
|
Errors
| Status | Error code | Cause |
|---|---|---|
400
|
crypto_invalid_argument
|
The key path is invalid, or the plaintext is larger than 64 KiB. |
400
|
crypto_operation_failed
|
Decryption or rewrapping failed. The ciphertext was altered, isn't valid Base64, or belongs to a different key. |
400
|
request_validation_failed
|
A required field is missing, or the plaintext is empty. |
404
|
crypto_key_not_found
|
No key exists at the path, the key is deleted, or the restore period has passed. Viewing a deleted key isn't an error: it returns 200 with isDeleted set to true. |
409
|
crypto_key_already_exists
|
A key, possibly a deleted one, already exists at the path. |
409
|
crypto_key_version_conflict
|
The key isn't at the startingVersion you passed to rotate. |
409
|
crypto_key_concurrent_modification
|
Another rotation happened at the same moment. Retry. |
409
|
crypto_key_version_cap_exceeded
|
The key already has 9,999 versions. |