package com.example.onetap_ssh.backup;

import android.util.Base64;

import com.example.onetap_ssh.crypto.CryptoException;
import com.example.onetap_ssh.crypto.CryptoParameters;
import com.example.onetap_ssh.util.BackupException;

import javax.crypto.SecretKey;

public class BackupData {

    private CryptoParameters parameters;

    private String database;

    private BackupGroup[] groups;

    private BackupData() {}

    public BackupData(CryptoParameters parameters, String database, BackupGroup[] groups) {
        this.parameters = parameters;
        this.database = database;
        this.groups = groups;
    }

    public CryptoParameters getParameters() {
        return parameters;
    }

    public String getDatabase() {
        return database;
    }



    public BackupGroup[] getGroups() {
        return groups;
    }

    public boolean isValid() {
        if(parameters == null || database == null || groups == null) return false;

        if(!parameters.isValid()) return false;

        for(BackupGroup group : groups) {
            if(!group.isValid()) return false;
        }

        return true;
    }

}
