if (!projectRoles.hasSecretData()) {
throw new IllegalStateException("Project role has no secret data");
}
ProjectRolesSecretData projectRolesSecretData;
try {
projectRolesSecretData = unlock(projectRoles.getSecretData(), user, ProjectRolesSecretData.newBuilder());
} catch (IOException e) {
throw new IllegalStateException("Error unlocking project", e);
}
int version = 0;
if (projectRolesSecretData.hasProjectKeyVersion()) {
version = projectRolesSecretData.getProjectKeyVersion();
}
ByteString projectKeyBytes = projectRolesSecretData.getProjectKey();
if (projectKeyBytes == null) {
throw new IllegalStateException();
}
if (version == 1) {