public static void install(Context context, String name, String alias)
            throws IOException {
        byte[] keychain;
        FileInputStream is = null;
        try {
            is = new FileInputStream(new File(context.getCacheDir(),
                    alias + KEY_PEM_FILE_EXTENSION));
            keychain = new byte[is.available()];
            int len = is.read(keychain);
            if (len != keychain.length) {
                throw new IOException("Install JKS failed, len: " + len);
            }
        } finally {
            NetBareUtils.closeQuietly(is);
        }

        Intent intent = new Intent(context, CertificateInstallActivity.class);
        intent.putExtra(KeyChain.EXTRA_CERTIFICATE, keychain);
        intent.putExtra(KeyChain.EXTRA_NAME, name);
        intent.putExtra(CertificateInstallActivity.EXTRA_ALIAS, alias);
        if (!(context instanceof Activity)) {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        context.startActivity(intent);
    }
Install the self-signed root certificate.

@param context Any context.
@param name Key chain name.
@param alias Key store alias.
@throws IOException If an IO error has occurred.
netbare-core/src/main/java/com/github/megatronking/netbare/ssl/JKS.java