code: protected KeyStore buildKeyStoreFromResources(String... certResources) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException{
  		KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
  		keyStore.load(null);
  		for (String res: certResources){
  			X509Certificate cert = loadX509CertificateFromResource(res);
  			String alias = cert.getSubjectX500Principal().getName();
  			keyStore.setCertificateEntry(alias, cert);
  		}
  		return keyStore;
  	}
docs: Build a keystore with certificates loaded from resource
  Certificates can be in binary or base64 DER/.crt format.
  @param certResources	the resource names
  @return	the key store
  @throws KeyStoreException		if the key store couldn't be created
  @throws CertificateException		if the certificate couldn't be loaded
  @throws NoSuchAlgorithmException	if the algorithm required does not exist
  @throws IOException				if the key store cannot be initialized