keystorefileutility.java

来自「Examples showing use of PKCS #12 and the」· Java 代码 · 共 28 行

JAVA
28
字号
package chapter8;

import java.io.FileOutputStream;
import java.security.KeyStore;

/**
 * Create some keystore files in the current directory.
 */
public class KeyStoreFileUtility
{
    public static void main(
        String[]    args)
        throws Exception
    {
        char[]   password = "storePassword".toCharArray();

        // create and save a JKS store
        KeyStore store = JKSStoreExample.createKeyStore();
        
        store.store(new FileOutputStream("keystore.jks"), password);

        // create and save a PKCS #12 store
        store = PKCS12StoreExample.createKeyStore();
        
        store.store(new FileOutputStream("keystore.p12"), password);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?