當前位置: 首頁>>代碼示例>>Java>>正文


Java PKIXParameters.isRevocationEnabled方法代碼示例

本文整理匯總了Java中java.security.cert.PKIXParameters.isRevocationEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java PKIXParameters.isRevocationEnabled方法的具體用法?Java PKIXParameters.isRevocationEnabled怎麽用?Java PKIXParameters.isRevocationEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.security.cert.PKIXParameters的用法示例。


在下文中一共展示了PKIXParameters.isRevocationEnabled方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: populateVariables

import java.security.cert.PKIXParameters; //導入方法依賴的package包/類
/**
 * Internal method to setup the internal state
 */
private void populateVariables(PKIXParameters pkixParam)
{
    // default value for testDate is current time
    testDate = pkixParam.getDate();
    if (testDate == null) {
        testDate = new Date(System.currentTimeMillis());
    }

    userCheckers = pkixParam.getCertPathCheckers();
    sigProvider = pkixParam.getSigProvider();

    if (pkixParam.isRevocationEnabled()) {
        // Examine OCSP security property
        ocspEnabled = AccessController.doPrivileged(
            new GetBooleanSecurityPropertyAction
                (OCSPChecker.OCSP_ENABLE_PROP));
        onlyEECert = AccessController.doPrivileged(
            new GetBooleanSecurityPropertyAction
                ("com.sun.security.onlyCheckRevocationOfEECert"));
    }
}
 
開發者ID:openjdk,項目名稱:jdk7-jdk,代碼行數:25,代碼來源:PKIXCertPathValidator.java

示例2: Builder

import java.security.cert.PKIXParameters; //導入方法依賴的package包/類
public Builder(PKIXParameters baseParameters)
{
    this.baseParameters = (PKIXParameters)baseParameters.clone();
    CertSelector constraints = baseParameters.getTargetCertConstraints();
    if (constraints != null)
    {
        this.targetConstraints = new PKIXCertStoreSelector.Builder(constraints).build();
    }
    Date checkDate = baseParameters.getDate();
    this.date = (checkDate == null) ? new Date() : checkDate;
    this.revocationEnabled = baseParameters.isRevocationEnabled();
    this.trustAnchors = baseParameters.getTrustAnchors();
}
 
開發者ID:thedrummeraki,項目名稱:Aki-SSL,代碼行數:14,代碼來源:PKIXExtendedParameters.java

示例3: doValidate

import java.security.cert.PKIXParameters; //導入方法依賴的package包/類
/**
 * Internal method to actually validate a constructed path.
 *
 * @return the valid policy tree
 */
private PolicyNode doValidate(
        TrustAnchor anchor, CertPath cpOriginal,
        ArrayList<X509Certificate> certList, PKIXParameters pkixParam,
        PolicyNodeImpl rootNode) throws CertPathValidatorException
{
    int certPathLen = certList.size();

    basicChecker = new BasicChecker(anchor, testDate, sigProvider, false);
    AlgorithmChecker algorithmChecker = new AlgorithmChecker(anchor);
    KeyChecker keyChecker = new KeyChecker(certPathLen,
        pkixParam.getTargetCertConstraints());
    ConstraintsChecker constraintsChecker =
        new ConstraintsChecker(certPathLen);

    PolicyChecker policyChecker =
        new PolicyChecker(pkixParam.getInitialPolicies(), certPathLen,
                          pkixParam.isExplicitPolicyRequired(),
                          pkixParam.isPolicyMappingInhibited(),
                          pkixParam.isAnyPolicyInhibited(),
                          pkixParam.getPolicyQualifiersRejected(),
                          rootNode);

    ArrayList<PKIXCertPathChecker> certPathCheckers =
        new ArrayList<PKIXCertPathChecker>();
    // add standard checkers that we will be using
    certPathCheckers.add(algorithmChecker);
    certPathCheckers.add(keyChecker);
    certPathCheckers.add(constraintsChecker);
    certPathCheckers.add(policyChecker);
    certPathCheckers.add(basicChecker);

    // only add a revocationChecker if revocation is enabled
    if (pkixParam.isRevocationEnabled()) {

        // Use OCSP if it has been enabled
        if (ocspEnabled) {
            OCSPChecker ocspChecker =
                new OCSPChecker(cpOriginal, pkixParam, onlyEECert);
            certPathCheckers.add(ocspChecker);
        }

        // Always use CRLs
        CrlRevocationChecker revocationChecker = new
            CrlRevocationChecker(anchor, pkixParam, certList, onlyEECert);
        certPathCheckers.add(revocationChecker);
    }

    // add user-specified checkers
    certPathCheckers.addAll(userCheckers);

    PKIXMasterCertPathValidator masterValidator =
        new PKIXMasterCertPathValidator(certPathCheckers);

    masterValidator.validate(cpOriginal, certList);

    return policyChecker.getPolicyTree();
}
 
開發者ID:openjdk,項目名稱:jdk7-jdk,代碼行數:63,代碼來源:PKIXCertPathValidator.java

示例4: doValidate

import java.security.cert.PKIXParameters; //導入方法依賴的package包/類
/**
 * Internal method to actually validate a constructed path.
 *
 * @return the valid policy tree
 */
private PolicyNode doValidate(
        TrustAnchor anchor, CertPath cpOriginal,
        ArrayList<X509Certificate> certList, PKIXParameters pkixParam,
        PolicyNodeImpl rootNode) throws CertPathValidatorException
{
    int certPathLen = certList.size();

    basicChecker = new BasicChecker(anchor, testDate, sigProvider, false);
    AlgorithmChecker algorithmChecker = new AlgorithmChecker(anchor);
    KeyChecker keyChecker = new KeyChecker(certPathLen,
        pkixParam.getTargetCertConstraints());
    ConstraintsChecker constraintsChecker =
        new ConstraintsChecker(certPathLen);

    PolicyChecker policyChecker =
        new PolicyChecker(pkixParam.getInitialPolicies(), certPathLen,
                          pkixParam.isExplicitPolicyRequired(),
                          pkixParam.isPolicyMappingInhibited(),
                          pkixParam.isAnyPolicyInhibited(),
                          pkixParam.getPolicyQualifiersRejected(),
                          rootNode);
    UntrustedChecker untrustedChecker = new UntrustedChecker();

    ArrayList<PKIXCertPathChecker> certPathCheckers =
        new ArrayList<PKIXCertPathChecker>();
    // add standard checkers that we will be using
    certPathCheckers.add(untrustedChecker);
    certPathCheckers.add(algorithmChecker);
    certPathCheckers.add(keyChecker);
    certPathCheckers.add(constraintsChecker);
    certPathCheckers.add(policyChecker);
    certPathCheckers.add(basicChecker);

    // only add a revocationChecker if revocation is enabled
    if (pkixParam.isRevocationEnabled()) {

        // Use OCSP if it has been enabled
        if (ocspEnabled) {
            OCSPChecker ocspChecker =
                new OCSPChecker(cpOriginal, pkixParam, onlyEECert);
            certPathCheckers.add(ocspChecker);
        }

        // Always use CRLs
        CrlRevocationChecker revocationChecker = new
            CrlRevocationChecker(anchor, pkixParam, certList, onlyEECert);
        certPathCheckers.add(revocationChecker);
    }

    // add user-specified checkers
    certPathCheckers.addAll(userCheckers);

    PKIXMasterCertPathValidator masterValidator =
        new PKIXMasterCertPathValidator(certPathCheckers);

    masterValidator.validate(cpOriginal, certList);

    return policyChecker.getPolicyTree();
}
 
開發者ID:greghaskins,項目名稱:openjdk-jdk7u-jdk,代碼行數:65,代碼來源:PKIXCertPathValidator.java


注:本文中的java.security.cert.PKIXParameters.isRevocationEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。