code: @Override
      public void updateState(X509Certificate cert)
          throws CertificateException, IOException, CertPathValidatorException {
  
          if (cert == null)
              return;
  
          X509CertImpl icert = X509CertImpl.toImpl(cert);
  
          /* see if certificate key has null parameters */
          if (PKIX.isDSAPublicKeyWithoutParams(icert.getPublicKey())) {
              keyParamsNeededFlag = true;
          }
  
          /* update certificate */
          this.cert = icert;
  
          /* update issuer DN */
          issuerDN = cert.getIssuerX500Principal();
  
          if (!X509CertImpl.isSelfIssued(cert)) {
  
              /*
               * update traversedCACerts only if this is a non-self-issued
               * intermediate CA cert
               */
              if (!init && cert.getBasicConstraints() != -1) {
                  traversedCACerts++;
              }
          }
  
          /* update subjectNamesTraversed only if this is the EE cert or if
             this cert is not self-issued */
          if (init || !X509CertImpl.isSelfIssued(cert)){
              X500Principal subjName = cert.getSubjectX500Principal();
              subjectNamesTraversed.add(X500Name.asX500Name(subjName));
  
              try {
                  SubjectAlternativeNameExtension subjAltNameExt
                      = icert.getSubjectAlternativeNameExtension();
                  if (subjAltNameExt != null) {
                      GeneralNames gNames = subjAltNameExt.get(
                              SubjectAlternativeNameExtension.SUBJECT_NAME);
                      for (GeneralName gName : gNames.names()) {
                          subjectNamesTraversed.add(gName.getName());
                      }
                  }
              } catch (IOException e) {
                  if (debug != null) {
                      debug.println("ForwardState.updateState() unexpected "
                          + "exception");
                      e.printStackTrace();
                  }
                  throw new CertPathValidatorException(e);
              }
          }
  
          init = false;
      }
docs: Update the state with the next certificate added to the path.
  
  @param cert the certificate which is used to update the state