code: public String validate(KeyStore keyStore, String keyAlias) throws CertificateException {
          String result = null;
          if (keyAlias != null) {
              try {
                  validate(keyStore, keyStore.getCertificate(keyAlias));
              } catch (KeyStoreException kse) {
                  logger.debug("", kse);
                  throw new CertificateException("Unable to validate certificate" +
                          " for alias [" + keyAlias + "]: " + kse.getMessage(), kse);
              }
              result = keyAlias;
          }
  	return result;
      }
docs: validates a specific alias inside of the keystore being passed in
  
  @param keyStore
  @param keyAlias
  @return the keyAlias if valid
  @throws CertificateException