get Key Store - Java Security

Java examples for Security:Key

Description

get Key Store

Demo Code


//package com.java2s;

import java.io.FileInputStream;

import java.security.KeyStore;

public class Main {

    public static final String KEY_STORE = "JKS";

    private static KeyStore getKeyStore(String keyStorePath, String password)
            throws Exception {
        FileInputStream in = new FileInputStream(keyStorePath);
        KeyStore keyStore = KeyStore.getInstance(KEY_STORE);
        keyStore.load(in, password.toCharArray());
        in.close();// www  . jav  a  2  s .  c om
        return keyStore;
    }
}

Related Tutorials