Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static void main(String[] argv) throws Exception {
        FileInputStream is = new FileInputStream("your.keystore");

        KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
        keystore.load(is, "my-keystore-password".toCharArray());

        // Get certificate
        java.security.cert.Certificate cert = keystore.getCertificate("myalias");
    }
}