當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。