Search in sources :

Example 1 with RestoreRequest

use of org.whispersystems.signalservice.internal.keybackup.protos.RestoreRequest in project Signal-Android by WhisperSystems.

the class KeyBackupCipher method createKeyRestoreRequest.

public static KeyBackupRequest createKeyRestoreRequest(byte[] kbsAccessKey, TokenResponse token, RemoteAttestation remoteAttestation, byte[] serviceId) {
    long now = System.currentTimeMillis();
    RestoreRequest restoreRequest = RestoreRequest.newBuilder().setServiceId(ByteString.copyFrom(serviceId)).setBackupId(ByteString.copyFrom(token.getBackupId())).setToken(ByteString.copyFrom(token.getToken())).setValidFrom(getValidFromSeconds(now)).setPin(ByteString.copyFrom(kbsAccessKey)).build();
    Request request = Request.newBuilder().setRestore(restoreRequest).build();
    return createKeyBackupRequest(request, remoteAttestation, "restore");
}
Also used : 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) RestoreRequest(org.whispersystems.signalservice.internal.keybackup.protos.RestoreRequest)

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