docs: @Override
      @FFDCIgnore({ com.ibm.websphere.security.CertificateMapNotSupportedException.class, com.ibm.websphere.security.CertificateMapFailedException.class })
      public String mapCertificate(X509Certificate[] chain) throws CertificateMapNotSupportedException, CertificateMapFailedException, RegistryException {
  
          if (BasicRegistryConfig.MAP_MODE_NOT_SUPPORTED.equalsIgnoreCase(certificateMapMode)) {
  
              if (tc.isDebugEnabled()) {
                  Tr.debug(tc, "Certificate authentication has been disabled for this basic registry.");
              }
              String msg = Tr.formatMessage(tc, "BASIC_REGISTRY_CERT_IGNORED");
              throw new CertificateMapNotSupportedException(msg);
  
          } else if (BasicRegistryConfig.MAP_MODE_CUSTOM.equalsIgnoreCase(certificateMapMode)) {
  
              if (chain == null || chain.length == 0) {
                  throw new IllegalArgumentException("cert is null");
              }
  
              /*
               * Use the custom certificate mapper.
               */
              try {
                  X509CertificateMapper mapper = iCertificateMapperRef.get();
                  if (mapper == null) {
                      String msg = Tr.formatMessage(tc, "BASIC_REGISTRY_MAPPER_NOT_BOUND");
                      throw new CertificateMapFailedException(msg);
                  }
  
                  if (tc.isDebugEnabled()) {
                      Tr.debug(tc, "Using custom X.509 certificate mapper: " + mapper.getClass());
                  }
  
                  String name = mapper.mapCertificate(chain);
                  if (tc.isDebugEnabled()) {
                      Tr.debug(tc, "The custom X.509 certificate mapper returned the following mapping: " + name);
                  }
  
                  if (name == null || !isValidUser(name)) {
                      String msg = Tr.formatMessage(tc, "BASIC_REGISTRY_MAPPED_NAME_NOT_FOUND", name);
                      throw new CertificateMapFailedException(msg);
                  }
                  return name;
  
              } catch (com.ibm.websphere.security.CertificateMapNotSupportedException e) {
                  String msg = Tr.formatMessage(tc, "BASIC_REGISTRY_CUSTOM_MAPPER_NOT_SUPPORTED");
                  throw new CertificateMapNotSupportedException(msg, e);
              } catch (com.ibm.websphere.security.CertificateMapFailedException e) {
                  String msg = Tr.formatMessage(tc, "BASIC_REGISTRY_CUSTOM_MAPPER_FAILED");
                  throw new CertificateMapFailedException(msg, e);
              }
  
          } else {
  
              if (chain == null || chain.length == 0 || chain[0] == null) {
                  throw new IllegalArgumentException("cert is null");
              }
  
              // getSubjectDN is denigrated
              String dn = chain[0].getSubjectX500Principal().getName();
              String name = LDAPUtils.getCNFromDN(dn);
              if (name == null || !isValidUser(name)) {
                  String msg = Tr.formatMessage(tc, "BASIC_REGISTRY_NAME_NOT_FOUND", dn);
                  throw new CertificateMapFailedException(msg);
              }
              return name;
  
          }
  
      }