更改java.security.KeyStore密码

时间:2012-10-11 21:36:11

标签: java keystore

有人知道如何更改java.security.KeyStore的密码吗?以下是我创建KeyStore的方法:

        keyStore = KeyStore.getInstance("PKCS12", BouncyCastleProvider.PROVIDER_NAME);
        keyStore.load(null, null);
        if (keyStore.containsAlias(CERTIFICATE_ALIAS)) {
            keyStore.deleteEntry(CERTIFICATE_ALIAS);
        }

        keyStore.setKeyEntry(PRIVATE_KEY_ALIAS, privateKey, password, chain);

        keyStoreFileOutputStream = application.openFileOutput(KEY_STORE_FILE_NAME, Application.MODE_PRIVATE);
        keyStore.store(keyStoreFileOutputStream, password);

0 个答案:

没有答案