• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DistributionPointList类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中edu.vt.middleware.crypt.x509.types.DistributionPointList的典型用法代码示例。如果您正苦于以下问题:Java DistributionPointList类的具体用法?Java DistributionPointList怎么用?Java DistributionPointList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

DistributionPointList类属于edu.vt.middleware.crypt.x509.types包,在下文中一共展示了DistributionPointList类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDistributionPoints

点赞 3

import edu.vt.middleware.crypt.x509.types.DistributionPointList; //导入依赖的package包/类
/**
 * Gets the distribution points.
 *
 * @param cert the cert
 * @return the url distribution points
 */
private URI[] getDistributionPoints(final X509Certificate cert) {
    final DistributionPointList points;
    try {
        points = new ExtensionReader(cert).readCRLDistributionPoints();
    } catch (final Exception e) {
        logger.error("Error reading CRLDistributionPoints extension field on {}", CertUtils.toString(cert), e);
        return new URI[0];
    }

    final List<URI> urls = new ArrayList<>();
    for (final DistributionPoint point : points.getItems()) {
        final Object location = point.getDistributionPoint();
        if (location instanceof String) {
            addURL(urls, (String) location);
        } else if (location instanceof GeneralNameList) {
            for (final GeneralName gn : ((GeneralNameList) location).getItems()) {
                addURL(urls, gn.getName());
            }
        } else {
            logger.warn("{} not supported. String or GeneralNameList expected.", location);
        }
    }

    return urls.toArray(new URI[urls.size()]);
}
 

开发者ID:hsj-xiaokang,
项目名称:springboot-shiro-cas-mybatis,
代码行数:32,
代码来源:CRLDistributionPointRevocationChecker.java

示例2: getDistributionPoints

点赞 3

import edu.vt.middleware.crypt.x509.types.DistributionPointList; //导入依赖的package包/类
private URL[] getDistributionPoints(final X509Certificate cert) {
    final DistributionPointList points;
    try {
        points = new ExtensionReader(cert).readCRLDistributionPoints();
    } catch (final Exception e) {
        logger.error(
                "Error reading CRLDistributionPoints extension field on " + CertUtils.toString(cert), e);
        return new URL[0];
    }

    final List<URL> urls = new ArrayList<URL>();
    for (DistributionPoint point : points.getItems()) {
        final Object location = point.getDistributionPoint();
        if (location instanceof String) {
            addURL(urls, (String) location);
        } else if (location instanceof GeneralNameList) {
            for (GeneralName gn : ((GeneralNameList) location).getItems()) {
                addURL(urls, gn.getName());
            }
        } else {
            logger.warn("{} not supported. String or GeneralNameList expected.", location);
        }
    }

    return urls.toArray(new URL[urls.size()]);
}
 

开发者ID:luotuo,
项目名称:cas4.0.x-server-wechat,
代码行数:27,
代码来源:CRLDistributionPointRevocationChecker.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)