use of org.whispersystems.signalservice.internal.keybackup.protos.BackupRequest in project Signal-Android by WhisperSystems.
the class KeyBackupCipher method createKeyBackupRequest.
public static KeyBackupRequest createKeyBackupRequest(byte[] kbsAccessKey, byte[] kbsData, TokenResponse token, RemoteAttestation remoteAttestation, byte[] serviceId, int tries) {
long now = System.currentTimeMillis();
BackupRequest backupRequest = BackupRequest.newBuilder().setServiceId(ByteString.copyFrom(serviceId)).setBackupId(ByteString.copyFrom(token.getBackupId())).setToken(ByteString.copyFrom(token.getToken())).setValidFrom(getValidFromSeconds(now)).setData(ByteString.copyFrom(kbsData)).setPin(ByteString.copyFrom(kbsAccessKey)).setTries(tries).build();
Request requestData = Request.newBuilder().setBackup(backupRequest).build();
return createKeyBackupRequest(requestData, remoteAttestation, "backup");
}
Aggregations