private PortabilityJob updateJobWithCredentials(UUID jobId, PortabilityJob job, String authData) {

    // Populate job with encrypted auth data
    JobAuthorization updatedJobAuthorization =
        job.jobAuthorization()
            .toBuilder()
            .setEncryptedAuthData(authData)
            .setState(CREDS_STORED)
            .build();
    job = job.toBuilder().setAndValidateJobAuthorization(updatedJobAuthorization).build();
    monitor.debug(
        () -> format("Updating job %s from CREDS_ENCRYPTION_KEY_GENERATED to CREDS_STORED", jobId),
        jobId);
    try {
      jobStore.updateJobWithCredentials(jobId, job);
      monitor.debug(() -> format("Updated job %s to CREDS_STORED", jobId), jobId,
          EventCode.API_JOB_CREDS_STORED);
    } catch (IOException e) {
      throw new RuntimeException("Unable to update job", e);
    }
    return job;
  }
Encrypt the export and import credentials with a new {@link SecretKey} and {@link PublicKey}
assigned to this job then update the data store to {@link JobAuthorization.State#CREDS_STORED}
state.
portability-api/src/main/java/org/datatransferproject/api/action/transfer/StartTransferJobAction.java