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)
          {
              LOG.error("Error while valid keystore", 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 the keystore to validate
  @param keyAlias the keyalias in the keystore to valid with
  @return the keyAlias if valid
  @throws CertificateException if keystore error and unable to validate