code: @Override
    public X509Certificate getClientCertificate()
      throws java.security.cert.CertificateException
    {
      TempBuffer tb = TempBuffer.create();
      byte []buffer = tb.buffer();
      int len = getClientCertificate(_socketFd, buffer, 0, buffer.length);
      X509Certificate cert = null;
  
      if (len > 0 && len < buffer.length) {
        try {
          CertificateFactory cf = CertificateFactory.getInstance("X.509");
          InputStream is = new ByteArrayInputStream(buffer, 0, len);
          cert = (X509Certificate) cf.generateCertificate(is);
          is.close();
        } catch (IOException e) {
          return null;
        }
      }
  
      TempBuffer.free(tb);
      tb = null;
  
      return cert;
    }
docs: Returns the client certificate.