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");
}
Aggregations