Skip to main content

io.enterpriseai.resources.EncryptionClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/EncryptionClient.java. Back to the Java SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Class EncryptionClient​

Envelope encryption and keys.

Constructor EncryptionClient​

EncryptionClient(Transport transport)

Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.

NameTypeDefaultRequiredDescription
transportTransportyesTransport shared by the sub-clients of one client.

EncryptionClient.createKey​

JsonNode createKey(Object body)

Create an encryption key. Creates a named key with its first version; the data key is generated and wrapped by OpenBao Transit when configured, locally otherwise. The name must be lowercase letters, digits, ., _ or -, at most 63 characters (400 invalid_request); a name already used answers 409 conflict. Needs tenant_admin or security_officer. Writes the audit event encryption.key.create.

Route: /v1/encryption/keys (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesName and purpose of the key.

Returns: JsonNode. Decoded JSON answer of the operation "Create an encryption key".

Raises: the typed errors of the transport (Errors).

EncryptionClient.createKey​

JsonNode createKey(Object body, RequestOptions options)

Create an encryption key. Creates a named key with its first version; the data key is generated and wrapped by OpenBao Transit when configured, locally otherwise. The name must be lowercase letters, digits, ., _ or -, at most 63 characters (400 invalid_request); a name already used answers 409 conflict. Needs tenant_admin or security_officer. Writes the audit event encryption.key.create.

Route: /v1/encryption/keys (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesName and purpose of the key.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Create an encryption key".

Raises: the typed errors of the transport (Errors).

EncryptionClient.decrypt​

JsonNode decrypt(Object body)

Decrypt a ciphertext. Decrypts an eaienc1 ciphertext of the tenant with the key version it names, checking the same aad as at encryption. Returns plaintext, or plaintext_base64 with as_base64 or when the data is not UTF-8 text, and key_version. Old versions keep decrypting after a rotation. Open to any member of the tenant. Writes the audit event encryption.decrypt.

Route: /v1/encryption/decrypt (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesCiphertext, associated data and output format.

Returns: JsonNode. Decoded JSON answer of the operation "Decrypt a ciphertext".

Raises: the typed errors of the transport (Errors).

EncryptionClient.decrypt​

JsonNode decrypt(Object body, RequestOptions options)

Decrypt a ciphertext. Decrypts an eaienc1 ciphertext of the tenant with the key version it names, checking the same aad as at encryption. Returns plaintext, or plaintext_base64 with as_base64 or when the data is not UTF-8 text, and key_version. Old versions keep decrypting after a rotation. Open to any member of the tenant. Writes the audit event encryption.decrypt.

Route: /v1/encryption/decrypt (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesCiphertext, associated data and output format.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Decrypt a ciphertext".

Raises: the typed errors of the transport (Errors).

EncryptionClient.encrypt​

JsonNode encrypt(Object body)

Encrypt data with a tenant key. Encrypts plaintext (UTF-8 text) or plaintext_base64 (bytes) with the current version of the key, bound to aad. Returns ciphertext (eaienc1:...), key_id and key_version. One of the two inputs is required, and base64 must be valid (400 invalid_request); an unknown key answers 404 key_not_found. Open to any member of the tenant. Writes the audit event encryption.encrypt (size only).

Route: /v1/encryption/encrypt (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesKey, data to encrypt and associated data.

Returns: JsonNode. Decoded JSON answer of the operation "Encrypt data with a tenant key".

Raises: the typed errors of the transport (Errors).

EncryptionClient.encrypt​

JsonNode encrypt(Object body, RequestOptions options)

Encrypt data with a tenant key. Encrypts plaintext (UTF-8 text) or plaintext_base64 (bytes) with the current version of the key, bound to aad. Returns ciphertext (eaienc1:...), key_id and key_version. One of the two inputs is required, and base64 must be valid (400 invalid_request); an unknown key answers 404 key_not_found. Open to any member of the tenant. Writes the audit event encryption.encrypt (size only).

Route: /v1/encryption/encrypt (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesKey, data to encrypt and associated data.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Encrypt data with a tenant key".

Raises: the typed errors of the transport (Errors).

EncryptionClient.listKeys​

Page<JsonNode> listKeys()

List the encryption keys. Lists the encryption keys of the tenant ordered by name: id, name, backend (openbao-transit or local), purpose, current version and dates. Never the key material. Open to any member of the tenant.

Route: /v1/encryption/keys (GET).

This element takes no parameter.

Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

Raises: the typed errors of the transport (Errors).

EncryptionClient.rotateKey​

JsonNode rotateKey(String id)

Rotate an encryption key. Adds a new version to the key: new encryptions use it, older ciphertexts keep decrypting with their own version. Needs tenant_admin or security_officer. Answers 404 key_not_found. Writes the audit event encryption.key.rotate.

Route: /v1/encryption/keys/{key_id}/rotate (POST).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) or name of the key.

Returns: JsonNode. Decoded JSON answer of the operation "Rotate an encryption key".

Raises: the typed errors of the transport (Errors).