gpt4 book ai didi

org.wildfly.security.ssl.X509CRLExtendedTrustManager类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 21:06:40 26 4
gpt4 key购买 nike

本文整理了Java中org.wildfly.security.ssl.X509CRLExtendedTrustManager类的一些代码示例,展示了X509CRLExtendedTrustManager类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X509CRLExtendedTrustManager类的具体详情如下:
包路径:org.wildfly.security.ssl.X509CRLExtendedTrustManager
类名称:X509CRLExtendedTrustManager

X509CRLExtendedTrustManager介绍

[英]Extension to the X509TrustManager interface to support CRL verification.
[中]扩展到X509TrustManager接口,以支持CRL验证。

代码示例

代码示例来源:origin: wildfly/wildfly

X509TrustManager build() throws NoSuchAlgorithmException, KeyStoreException, ConfigXMLParseException {
    final String algorithm = this.algorithm != null ? this.algorithm : TrustManagerFactory.getDefaultAlgorithm();
    Provider provider = findProvider(providers, providerName, TrustManagerFactory.class, algorithm);
    if (provider == null) {
      throw xmlLog.xmlUnableToIdentifyProvider(xmlLocation, providerName, "TrustManagerFactory", algorithm);
    }
    final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(algorithm, provider);
    if (crl) {
      return new X509CRLExtendedTrustManager(trustStore, trustManagerFactory, crlStream, maxCertPath, null);
    } else {
      trustManagerFactory.init(trustStore);
    }
    for (TrustManager trustManager : trustManagerFactory.getTrustManagers()) {
      if (trustManager instanceof X509TrustManager) {
        return (X509TrustManager) trustManager;
      }
    }
    throw ElytronMessages.log.noDefaultTrustManager();
  }
}

代码示例来源:origin: wildfly/wildfly

CertStoreParameters csp = new CollectionCertStoreParameters(getCRLs(crlStream));
CertStore store = CertStore.getInstance("Collection", csp);
params.addCertStore(store);

代码示例来源:origin: org.wildfly.security/wildfly-elytron

X509TrustManager build() throws NoSuchAlgorithmException, KeyStoreException, ConfigXMLParseException {
    final String algorithm = this.algorithm != null ? this.algorithm : TrustManagerFactory.getDefaultAlgorithm();
    Provider provider = findProvider(providers, providerName, TrustManagerFactory.class, algorithm);
    if (provider == null) {
      throw xmlLog.xmlUnableToIdentifyProvider(xmlLocation, providerName, "TrustManagerFactory", algorithm);
    }
    final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(algorithm, provider);
    if (crl) {
      return new X509CRLExtendedTrustManager(trustStore, trustManagerFactory, crlStream, maxCertPath, null);
    } else {
      trustManagerFactory.init(trustStore);
    }
    for (TrustManager trustManager : trustManagerFactory.getTrustManagers()) {
      if (trustManager instanceof X509TrustManager) {
        return (X509TrustManager) trustManager;
      }
    }
    throw ElytronMessages.log.noDefaultTrustManager();
  }
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-ssl

CertStoreParameters csp = new CollectionCertStoreParameters(getCRLs(crlStream));
CertStore store = CertStore.getInstance("Collection", csp);
params.addCertStore(store);

代码示例来源:origin: org.wildfly.security/wildfly-elytron-client

X509TrustManager build() throws NoSuchAlgorithmException, KeyStoreException, ConfigXMLParseException {
    final String algorithm = this.algorithm != null ? this.algorithm : TrustManagerFactory.getDefaultAlgorithm();
    Provider provider = findProvider(providers, providerName, TrustManagerFactory.class, algorithm);
    if (provider == null) {
      throw xmlLog.xmlUnableToIdentifyProvider(xmlLocation, providerName, "TrustManagerFactory", algorithm);
    }
    final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(algorithm, provider);
    if (crl) {
      return new X509CRLExtendedTrustManager(trustStore, trustManagerFactory, crlStream, maxCertPath, null);
    } else {
      trustManagerFactory.init(trustStore);
    }
    for (TrustManager trustManager : trustManagerFactory.getTrustManagers()) {
      if (trustManager instanceof X509TrustManager) {
        return (X509TrustManager) trustManager;
      }
    }
    throw ElytronMessages.log.noDefaultTrustManager();
  }
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

CertStoreParameters csp = new CollectionCertStoreParameters(getCRLs(crlStream));
CertStore store = CertStore.getInstance("Collection", csp);
params.addCertStore(store);

代码示例来源:origin: org.jboss.eap/wildfly-client-all

X509TrustManager build() throws NoSuchAlgorithmException, KeyStoreException, ConfigXMLParseException {
    final String algorithm = this.algorithm != null ? this.algorithm : TrustManagerFactory.getDefaultAlgorithm();
    Provider provider = findProvider(providers, providerName, TrustManagerFactory.class, algorithm);
    if (provider == null) {
      throw xmlLog.xmlUnableToIdentifyProvider(xmlLocation, providerName, "TrustManagerFactory", algorithm);
    }
    final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(algorithm, provider);
    if (crl) {
      return new X509CRLExtendedTrustManager(trustStore, trustManagerFactory, crlStream, maxCertPath, null);
    } else {
      trustManagerFactory.init(trustStore);
    }
    for (TrustManager trustManager : trustManagerFactory.getTrustManagers()) {
      if (trustManager instanceof X509TrustManager) {
        return (X509TrustManager) trustManager;
      }
    }
    throw ElytronMessages.log.noDefaultTrustManager();
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

CertStoreParameters csp = new CollectionCertStoreParameters(getCRLs(crlStream));
CertStore store = CertStore.getInstance("Collection", csp);
params.addCertStore(store);

代码示例来源:origin: wildfly/wildfly-core

private ValueSupplier<TrustManager> createX509CRLExtendedTrustManager(ServiceBuilder<TrustManager> serviceBuilder, OperationContext context, String algorithm, String providerName, InjectedValue<Provider[]> providersInjector, InjectedValue<KeyStore> keyStoreInjector, ModelNode crlNode) throws OperationFailedException {
  String crlPath = PATH.resolveModelAttribute(context, crlNode).asStringOrNull();
  String crlRelativeTo = RELATIVE_TO.resolveModelAttribute(context, crlNode).asStringOrNull();
  int certPath = MAXIMUM_CERT_PATH.resolveModelAttribute(context, crlNode).asInt();
  final InjectedValue<PathManager> pathManagerInjector = new InjectedValue<>();
  if (crlPath != null) {
    if (crlRelativeTo != null) {
      serviceBuilder.addDependency(PathManagerService.SERVICE_NAME, PathManager.class, pathManagerInjector);
      serviceBuilder.requires(pathName(crlRelativeTo));
    }
  }
  return () -> {
    TrustManagerFactory trustManagerFactory = createTrustManagerFactory(providersInjector.getOptionalValue(), providerName, algorithm);
    KeyStore keyStore = keyStoreInjector.getOptionalValue();
    if (crlPath != null) {
      try {
        X509CRLExtendedTrustManager trustManager = new X509CRLExtendedTrustManager(keyStore, trustManagerFactory, new FileInputStream(resolveFileLocation(crlPath, crlRelativeTo, pathManagerInjector)), certPath, null);
        return createReloadableX509CRLTrustManager(crlPath, crlRelativeTo, certPath, pathManagerInjector, trustManagerFactory, keyStore, trustManager);
      } catch (FileNotFoundException e) {
        throw ElytronSubsystemMessages.ROOT_LOGGER.unableToAccessCRL(e);
      }
    }
    return new X509CRLExtendedTrustManager(keyStore, trustManagerFactory, null, certPath, null);
  };
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com