当前位置: 首页>>代码示例>>Java>>正文


Java CertPathValidatorException.getMessage方法代码示例

本文整理汇总了Java中java.security.cert.CertPathValidatorException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java CertPathValidatorException.getMessage方法的具体用法?Java CertPathValidatorException.getMessage怎么用?Java CertPathValidatorException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.security.cert.CertPathValidatorException的用法示例。


在下文中一共展示了CertPathValidatorException.getMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareNextCertO

import java.security.cert.CertPathValidatorException; //导入方法依赖的package包/类
protected static void prepareNextCertO(
    CertPath certPath,
    int index,
    Set criticalExtensions,
    List pathCheckers)
    throws CertPathValidatorException
{
    List certs = certPath.getCertificates();
    X509Certificate cert = (X509Certificate)certs.get(index);
    //
    // (o)
    //

    Iterator tmpIter;
    tmpIter = pathCheckers.iterator();
    while (tmpIter.hasNext())
    {
        try
        {
            ((PKIXCertPathChecker)tmpIter.next()).check(cert, criticalExtensions);
        }
        catch (CertPathValidatorException e)
        {
            throw new CertPathValidatorException(e.getMessage(), e.getCause(), certPath, index);
        }
    }
    if (!criticalExtensions.isEmpty())
    {
        throw new ExtCertPathValidatorException("Certificate has unsupported critical extension: " + criticalExtensions, null, certPath,
            index);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:33,代码来源:RFC3280CertPathUtilities.java

示例2: toInvalidCertificates

import java.security.cert.CertPathValidatorException; //导入方法依赖的package包/类
private Function<Map<CertificateDetails, CertificateValidity>, InvalidCertificateDto> toInvalidCertificates() {
    return input -> {
        CertificateDetails certificateDetail = getOnlyElement(input.keySet());
        CertificateValidity certificateValidity = getOnlyElement(input.values());

        CertPathValidatorException certPathValidatorException = certificateValidity.getException().get();
        return new InvalidCertificateDto(
                certificateDetail.getIssuerId(),
                certPathValidatorException.getReason(),
                certificateDetail.getKeyUse(),
                certificateDetail.getFederationEntityType(),
                certPathValidatorException.getMessage());
    };
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:15,代码来源:CertificateValidityChecker.java

示例3: main

import java.security.cert.CertPathValidatorException; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {

        Throwable[] causes = {
                new Throwable(),
                new Throwable("message"),
                new Throwable("message", new Throwable()) };

        for (Throwable cause: causes) {
            CertPathValidatorException cpve =
                new CertPathValidatorException(cause);

            // from CertPathValidatorException(Throwable cause) spec:
            // The detail message is set to (cause==null ? null : cause.toString() )
            // (which typically contains the class and detail message of cause).
            String expMsg = (cause == null ? null : cause.toString());
            String actualMsg = cpve.getMessage();

            boolean msgsEqual =
                (expMsg == null ? actualMsg == null : expMsg.equals(actualMsg));
            if (!msgsEqual) {
                System.out.println("expected message:" + expMsg);
                System.out.println("getMessage():" + actualMsg);
                failed = true;
            }
        }
        if (failed) {
            throw new Exception("Some tests FAILED");
        }
    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:30,代码来源:GetMessage.java


注:本文中的java.security.cert.CertPathValidatorException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。