Java Key Create getKeyStore(File file, char[] storePass)

Here you can find the source of getKeyStore(File file, char[] storePass)

Description

get Key Store

License

Open Source License

Declaration

public static KeyStore getKeyStore(File file, char[] storePass) throws IOException, GeneralSecurityException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.GeneralSecurityException;

import java.security.KeyStore;

public class Main {
    public static KeyStore getKeyStore(String fileURL, char[] storePass)
            throws IOException, GeneralSecurityException {
        File f = new File(fileURL);
        return getKeyStore(f, storePass);
    }/*from   w ww . j  a  v  a 2s. c  o m*/

    public static KeyStore getKeyStore(File file, char[] storePass) throws IOException, GeneralSecurityException {
        FileInputStream ksInputStream = new FileInputStream(file);
        KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
        ks.load(ksInputStream, storePass);
        return ks;
    }
}

Related

  1. getKeyStore()
  2. getKeyStore()
  3. getKeyStore(byte[] bytes, char[] password)
  4. getKeyStore(Certificate[] certificateChain, PrivateKey privateKey, char[] password)
  5. getKeyStore(char[] password)
  6. getKeyStore(File keystore)
  7. getKeyStore(File keyStore)
  8. getKeyStore(final URL url, final String password)
  9. getKeyStore(InputStream ksStream, char[] storePass)