Posts

Showing posts from July, 2017

Get SSL Certificates expiration dates using Simple Java Code

Image
I have been looking for neat solution to find out the expiration dates for WebLogic Server using SSL Certificates in a given Java KeyStore, The limitation with Unix and Python scripts would be that we will end up working with the string value that Java keytool Utility returns. After several trials to be more effective, I believe it is better to do this using Java Code. So below snippet would be of some help to those who are looking for similar thing. import java.io.FileInputStream; import java.security.KeyStore; import java.util.Enumeration; import java.io.IOException; import java.security.cert.X509Certificate; import java.security.*; import java.util.Date; import java.text.SimpleDateFormat; import java.util.*; public class sslcertsExpirydates_2 { public static void main(String[] argv) throws Exception { try { KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); keystore.load(new FileInputStream("/u01/app/oracle/product/fmw/wlserver/serve...