public static void loadX509Cert(Certificate cert,String certAlias,KeyStore keyStore) throws KeyStoreException {
  keyStore.setCertificateEntry(certAlias,cert);
}

public static void loadX509Cert ( Certificate cert , String certAlias , KeyStore keyStore ) throws KeyStoreException { keyStore . setCertificateEntry ( certAlias , cert ) ; }
load a certificate to a key store with a name
