public static KeyStore loadCacertsKeyStore(String provider){
  File file=new File(System.getProperty("java.home"),"lib");
  file=new File(file,"security");
  file=new File(file,"cacerts");
  FileInputStream fin=null;
  try {
    fin=new FileInputStream(file);
    KeyStore k;
    if (provider == null)     k=KeyStore.getInstance("JKS");
 else     k=KeyStore.getInstance("JKS",provider);
    k.load(fin,null);
    return k;
  }
 catch (  Exception e) {
    throw new PdfException(e);
  }
 finally {
    try {
      if (fin != null) {
        fin.close();
      }
    }
 catch (    Exception ex) {
    }
  }
}

public static KeyStore loadCacertsKeyStore ( String provider ) { File file = new File ( System . getProperty ( "java.home" ) , "lib" ) ; file = new File ( file , "security" ) ; file = new File ( file , "cacerts" ) ; FileInputStream fin = null ; try { fin = new FileInputStream ( file ) ; KeyStore k ; if ( provider == null ) k = KeyStore . getInstance ( "JKS" ) ; else k = KeyStore . getInstance ( "JKS" , provider ) ; k . load ( fin , null ) ; return k ; } catch ( Exception e ) { throw new PdfException ( e ) ; } finally { try { if ( fin != null ) { fin . close ( ) ; } } catch ( Exception ex ) { } } }
loads the default root certificates at & lt ; java . home & gt ; / lib / security / cacerts .
