code: public void verify() throws CredentialException {
          try {
              String caCertsLocation = "file:" + CoGProperties.getDefault().getCaCertLocations();
  
              KeyStore keyStore = Stores.getTrustStore(caCertsLocation + "/" + Stores.getDefaultCAFilesPattern());
              CertStore crlStore = Stores.getCRLStore(caCertsLocation + "/" + Stores.getDefaultCRLFilesPattern());
              ResourceSigningPolicyStore sigPolStore = Stores.getSigningPolicyStore(caCertsLocation + "/" + Stores.getDefaultSigningPolicyFilesPattern());
  
              X509ProxyCertPathParameters parameters = new X509ProxyCertPathParameters(keyStore, crlStore, sigPolStore, false);
              X509ProxyCertPathValidator validator = new X509ProxyCertPathValidator();
              validator.engineValidate(CertificateUtil.getCertPath(certChain), parameters);
          } catch (Exception e) {
              throw new CredentialException(e);
          }
      }
docs: Verifies the validity of the credentials. All certificate path validation is performed using trusted
  certificates in default locations.
  
  @exception CredentialException
  if one of the certificates in the chain expired or if path validiation fails.