// Path: AndroidVault/vault/src/main/java/com/bottlerocketstudios/vault/keys/storage/KeyStorage.java
// public interface KeyStorage {
//     /**
//      * Load key from storage
//      * @return Key if available or null
//      */
//     SecretKey loadKey(Context context);
// 
//     /**
//      * Save key to storage
//      * @return True if successful
//      */
//     boolean saveKey(Context context, SecretKey secretKey);
// 
//     /**
//      * Remove key from storage
//      */
//     void clearKey(Context context);
// 
//     /**
//      * Determine if key is available
//      */
//     boolean hasKey(Context context);
// 
//     /**
//      * Return the type of key storage used.
//      */
//     KeyStorageType getKeyStorageType();
// }
// 
// Path: AndroidVault/vault/src/main/java/com/bottlerocketstudios/vault/keys/storage/KeyStorageType.java
// public enum KeyStorageType {
//     ANDROID_KEYSTORE,
//     ANDROID_KEYSTORE_AUTHENTICATED,
//     OBFUSCATED,
//     NOT_PERSISTENT
// }


import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import com.bottlerocketstudios.vault.keys.storage.KeyStorage;
import com.bottlerocketstudios.vault.keys.storage.KeyStorageType;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import javax.crypto.SecretKey;
        mKeyStorage.clearKey(mContext);
    }

    @Override
    public void rekeyStorage(SecretKey secretKey) {
        clearStorage();
        setKey(secretKey);
    }

    @Override
    public void setKey(SecretKey secretKey) {
        mKeyStorage.saveKey(mContext, secretKey);
    }

    @Override
    public boolean isKeyAvailable() {
        return mKeyStorage.hasKey(mContext);
    }

    @Override
    public void setDebugEnabled(boolean enabled) {
        mDebugEnabled = enabled;
    }

    @Override
    public boolean isDebugEnabled() {
        return mDebugEnabled;
    }

    @Override
// Path: AndroidVault/vault/src/main/java/com/bottlerocketstudios/vault/keys/storage/KeyStorage.java
// public interface KeyStorage {
//     /**
//      * Load key from storage
//      * @return Key if available or null
//      */
//     SecretKey loadKey(Context context);
// 
//     /**
//      * Save key to storage
//      * @return True if successful
//      */
//     boolean saveKey(Context context, SecretKey secretKey);
// 
//     /**
//      * Remove key from storage
//      */
//     void clearKey(Context context);
// 
//     /**
//      * Determine if key is available
//      */
//     boolean hasKey(Context context);
// 
//     /**
//      * Return the type of key storage used.
//      */
//     KeyStorageType getKeyStorageType();
// }
// 
// Path: AndroidVault/vault/src/main/java/com/bottlerocketstudios/vault/keys/storage/KeyStorageType.java
// public enum KeyStorageType {
//     ANDROID_KEYSTORE,
//     ANDROID_KEYSTORE_AUTHENTICATED,
//     OBFUSCATED,
//     NOT_PERSISTENT
// }


// Path: AndroidVault/vault/src/main/java/com/bottlerocketstudios/vault/StandardSharedPreferenceVault.java
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import com.bottlerocketstudios.vault.keys.storage.KeyStorage;
import com.bottlerocketstudios.vault.keys.storage.KeyStorageType;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import javax.crypto.SecretKey;

        mKeyStorage.clearKey(mContext);
    }

    @Override
    public void rekeyStorage(SecretKey secretKey) {
        clearStorage();
        setKey(secretKey);
    }

    @Override
    public void setKey(SecretKey secretKey) {
        mKeyStorage.saveKey(mContext, secretKey);
    }

    @Override
    public boolean isKeyAvailable() {
        return mKeyStorage.hasKey(mContext);
    }

    @Override
    public void setDebugEnabled(boolean enabled) {
        mDebugEnabled = enabled;
    }

    @Override
    public boolean isDebugEnabled() {
        return mDebugEnabled;
    }

    @Override
    public KeyStorageType getKeyStorageType() {