public static String KeyInfo() {
    InputStream inputStream = null;
InputStreamReader isr = null;
BufferedReader br = null;
StringBuffer sb = new StringBuffer();
    try {
        File file = new File(Constants.KEYINFO_PATH);
        if (file.exists()) {
            inputStream = new FileInputStream(file);
} else {
            Log.d("zfr","未讀取到檔案內容");
            return null;
}
        //inputStream = assetManager.open("cacert-payplus.ubin.top.pem");
isr = new InputStreamReader(inputStream);
br = new BufferedReader(isr);
sb.append(br.readLine());
String line = null;
        while ((line = br.readLine()) != null) {
            sb.append("\n" + line);
}

        br.close();
isr.close();
inputStream.close();
} catch (IOException e) {
        e.printStackTrace();
} finally {
        try {
            if (br != null) {
                br.close();
}
            if (isr != null) {
                isr.close();
}
            if (inputStream != null) {
                inputStream.close();
}
        } catch (IOException e) {
            e.printStackTrace();
}
    }
    //return sb.toString();
keyInfo = sb.toString();
//Log.d("zfr_證書===", sb.toString());
return keyInfo;
}
if (SignUtil.KeyInfo() == null) {
    Log.d("zfr", "讀取檔案失敗");
    return null;
}

把證書檔案放在自己的機器中(目錄如下):

public static final String KEYINFO_PATH = FinancialApplication.mApp.getFilesDir() + File.separator + "config.properties";