@UESComponent public interface UESVaultService
Also note that SecuredObject is only intended to store relatively small size data, such as passwords. If you need to store large objects securely, consider encrypting such objects in a symmetric way using randomly generated password and use secure preferences to store the password.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_KEY_PROVIDER_ID
ID of default key provider to be used with secured container.
|
Modifier and Type | Method and Description |
---|---|
void |
createContainer(java.lang.String containerId,
Creates a new secured container.
|
void |
deleteContainer(java.lang.String containerId)
Deletes the secured container (container must be empty in order to be deleted).
|
void |
deleteSecuredObject(java.lang.String containerId,
Deletes a secured object from container with the given ID.
|
SecuredObject |
getSecuredObject(java.lang.String containerID,
Reads a secured object from container with the given ID.
|
SecuredObject |
putSecuredObject(java.lang.String containerID,
Stores the secured object in container with the given ID.
|
SecuredObject |
updateSecuredObject(java.lang.String containerID,
Updates existing secured object in container with given ID.
|
containerId
- ID of the new container (must be unique in the scope of the vault). If the given value is not
unique or the value is empty, UESVaultServiceRTException
is thrown.containerName
- Name of the new containerkeyProvider
- ID of key provider to be used with the created container. If null
, default key
provider defined in constant UESVaultService.DEFAULT_KEY_PROVIDER_ID
is used. If the given
provider is not defined, UESVaultServiceRTException
is thrown.UESVaultServiceRTException
- In case the creation of the container is not possible.UESVaultServiceRTException
is thrown.containerId
- ID of the container to be deleted.UESVaultServiceRTException
- If the deleted container is not empty or the container is not deleted by its
owner.UESVaultServiceRTException
is thrown.containerID
- ID of the container where to store the secured object. If the ID is empty or container with the
given ID does not exist, UESVaultServiceRTException
is thrown.secObject
- The secured object to be stored in the container. ID of the secured object must be unique in the
scope of the container, otherwise UESVaultServiceRTException
is thrown.UESVaultServiceRTException
- If the secured object cannot be stored.UESVaultServiceRTException
is thrown. (Unlike other
operations, only directly logged owner is allowed to read the data. It is not possible to read data as owner logged
via cz.ues.platform.security.authn.UESAuthenticationService#executeAs(String, cz.ues.platform.commons.lang.UESCallable
).containerID
- ID of the container where to look for the secured object. In case no container with the
given ID exists, null
is returned.objectID
- ID of the secured object to be read. In case no secured object with the given ID exists in the
given container, null
is returned.null
if no such object exists.UESVaultServiceRTException
- If the secured object cannot be read.containerID
- ID of container where to update secured object. If the ID is empty or container with the
given ID does not exist, UESVaultServiceRTException
is thrown.secObject
- The secured object to be updated in container. ID of the secured object must be set and exists
in the scope of the container, otherwise UESVaultServiceRTException
is thrown.UESVaultServiceRTException
- If the secured object cannot be updated.UESVaultServiceRTException
is thrown.containerId
- ID of container from which to delete the secured object.objectID
- ID of the secured object to delete.UESVaultServiceRTException
- If the secured object cannot be deleted.