code: public X509Certificate getIdentityCertificate() {
          try {
              return BouncyCastleUtil.getIdentityCertificate(this.certChain);
          } catch (CertificateException e) {
              logger.debug("Error getting certificate identity.", e);
              return null;
          }
      }
docs: Returns the identity certificate of this credential. The identity certificate is the first certificate
  in the chain that is not an impersonation proxy certificate.
  
  @return <code>X509Certificate</code> the identity cert. Null, if unable to get the identity certificate
  (an error occurred)