@Transactional
public Response create(@Context UriInfo uriInfo, CreateUserRepresentation request) throws CryptographicException {
request.validate();
if (userDAO.contains(request.getId())) {
final ValidationException e = new ValidationException();
e.addReason("username is already taken");
throw e;
}
final KeySet keySet = generator.generate(request.getId(), request.getPassword());
final User user = userDAO.saveOrUpdate(new User(keySet));