Search in sources :

Example 1 with BackupRequest

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");
}
Also used : BackupRequest(org.whispersystems.signalservice.internal.keybackup.protos.BackupRequest) KeyBackupRequest(org.whispersystems.signalservice.internal.contacts.entities.KeyBackupRequest) BackupRequest(org.whispersystems.signalservice.internal.keybackup.protos.BackupRequest) DeleteRequest(org.whispersystems.signalservice.internal.keybackup.protos.DeleteRequest) Request(org.whispersystems.signalservice.internal.keybackup.protos.Request) RestoreRequest(org.whispersystems.signalservice.internal.keybackup.protos.RestoreRequest) KeyBackupRequest(org.whispersystems.signalservice.internal.contacts.entities.KeyBackupRequest)

Aggregations

KeyBackupRequest (org.whispersystems.signalservice.internal.contacts.entities.KeyBackupRequest)1 BackupRequest (org.whispersystems.signalservice.internal.keybackup.protos.BackupRequest)1 DeleteRequest (org.whispersystems.signalservice.internal.keybackup.protos.DeleteRequest)1 Request (org.whispersystems.signalservice.internal.keybackup.protos.Request)1 RestoreRequest (org.whispersystems.signalservice.internal.keybackup.protos.RestoreRequest)1