JKS: List aliases : JKS « Security « Java Tutorial






import java.io.FileInputStream;
import java.security.KeyStore;
import java.util.Enumeration;

public class MainClass {
  public static void main(String args[]) throws Exception {
    String pass = "wshr.ut";
    String name = "mykeystore";
    FileInputStream in = new FileInputStream(name);
    KeyStore ks = KeyStore.getInstance("JKS");
    ks.load(in, pass.toCharArray());
    Enumeration e = ks.aliases();
    while (e.hasMoreElements()) {
      System.out.println(e.nextElement());
    }

  }
}








36.19.JKS
36.19.1.Use JKS
36.19.2.Use JKS KeyStore to load key
36.19.3.JKS: List aliases
36.19.4.JKS keystore: get certificate chain