1
我成功創建了我保存到位於「C:\ test \ myKeystore.bks」中的myKeystore.bks文件。 如何在我的應用程序中導入此密鑰庫以完成握手?在我的應用程序中導入密鑰庫
InputStream in = context.getResources().openRawResource(R.raw.mykeystore);
我有以下從Antoine`s博客代碼其中指出:「現在你可以將密鑰存儲複製的原始資源的資源下,Android應用程式/生/」
private SSLSocketFactory newSslSocketFactory() {
try {
// Get an instance of the Bouncy Castle KeyStore format
KeyStore trusted = KeyStore.getInstance("BKS");
// Get the raw resource, which contains the keystore with
// your trusted certificates (root and any intermediate certs)
InputStream in = context.getResources().openRawResource(R.raw.mykeystore);
try {
預先感謝您。