code: public Certificate get(KeyStoreChooser keyStoreChooser, CertificateChooserByAlias certificateChooserByAlias) {
          CacheCert cacheCert = new CacheCert(keyStoreChooser.getKeyStoreName(), certificateChooserByAlias.getAlias());
          Certificate retrievedCertificate = cache.get(cacheCert);
  
          if (retrievedCertificate != null) {
              return retrievedCertificate;
          }
  
          KeyStore keyStore = keyStoreRegistry.get(keyStoreChooser);
  
          if (keyStore != null) {
              CertificateFactoryBean factory = new CertificateFactoryBean();
              factory.setKeystore(keyStore);
              factory.setAlias(certificateChooserByAlias.getAlias());
              try {
                  factory.afterPropertiesSet();
                  Certificate certificate = (Certificate) factory.getObject();
  
                  if (certificate != null) {
                      cache.put(cacheCert, certificate);
                  }
                  return certificate;
              } catch (Exception e) {
                  throw new CertificateException("error initializing the certificate factory bean", e);
              }
          }
  
          return null;
      }
docs: Returns the selected certificate or null if not found.
  
  @param keyStoreChooser         the keystore chooser
  @param certificateChooserByAlias the certificate chooser by alias
  @return the selected certificate or null if not found