// Path: app/src/main/java/project/android/MainActivity.java
// public static File sRemouseDir = null;
// 
// Path: app/src/main/java/project/android/MainActivity.java
// public static SharedPreferences sSharedPrefs;


import android.content.SharedPreferences;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.UnrecoverableEntryException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import static project.android.MainActivity.sRemouseDir;
import static project.android.MainActivity.sSharedPrefs;
package project.android.security;




/**
 * Manages the operations on the <code>KeyStore</code>.
 *
 * <p>
 *     This class provides a {@link java.security.KeyStore} which stores :
 *     <ul>
 *         <li> The private key ({@link java.security.PrivateKey}).</li>
 *         <li>
 *             A self-signed certificate ({@link java.security.cert.Certificate})
 *             that contains the public key and the digital signature.
 *         </li>
 *     </ul>
 *     The <code>KeyStore</code> is protected by a randomly generated
 *     password.
 * </p>
 *
 * @see project.android.security.EKEProvider
 * @see java.security.KeyStore
 * @see java.security.KeyPair
 * @see java.security.cert.Certificate
 */
class KeyStoreManager {

    private KeyStore mKeyStore;

    private static final String KEY_STORE_TYPE = "pkcs12";
    private static final String KEY_STORE_ALIAS = "Remouse KeyStore";
    private static final String KEY_STORE_PASSWORD = generateKSPassword();
// Path: app/src/main/java/project/android/MainActivity.java
// public static File sRemouseDir = null;
// 
// Path: app/src/main/java/project/android/MainActivity.java
// public static SharedPreferences sSharedPrefs;


// Path: app/src/main/java/project/android/security/KeyStoreManager.java
import android.content.SharedPreferences;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.UnrecoverableEntryException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import static project.android.MainActivity.sRemouseDir;
import static project.android.MainActivity.sSharedPrefs;

package project.android.security;




/**
 * Manages the operations on the <code>KeyStore</code>.
 *
 * <p>
 *     This class provides a {@link java.security.KeyStore} which stores :
 *     <ul>
 *         <li> The private key ({@link java.security.PrivateKey}).</li>
 *         <li>
 *             A self-signed certificate ({@link java.security.cert.Certificate})
 *             that contains the public key and the digital signature.
 *         </li>
 *     </ul>
 *     The <code>KeyStore</code> is protected by a randomly generated
 *     password.
 * </p>
 *
 * @see project.android.security.EKEProvider
 * @see java.security.KeyStore
 * @see java.security.KeyPair
 * @see java.security.cert.Certificate
 */
class KeyStoreManager {

    private KeyStore mKeyStore;

    private static final String KEY_STORE_TYPE = "pkcs12";
    private static final String KEY_STORE_ALIAS = "Remouse KeyStore";
    private static final String KEY_STORE_PASSWORD = generateKSPassword();
    private static final String KEY_STORE_NAME = sRemouseDir + "/remouse_keystore";