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


Java CertPathValidatorResult类代码示例

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


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

示例1: engineValidate

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
public CertPathValidatorResult engineValidate(CertPath certPath,
        CertPathParameters params) throws CertPathValidatorException,
        InvalidAlgorithmParameterException {
    ++sw;
    if (certPath == null) {
        if ((sw % 2) == 0) {
            throw new CertPathValidatorException("certPath null");
        }
    }
    if (params == null) {
        if ((sw % 3) == 0) {
            throw new InvalidAlgorithmParameterException("params null");
        }
    }
    return null;
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:17,代码来源:MyCertPathValidatorSpi.java

示例2: testCertPathValidator

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
@TestTargets({
    @TestTargetNew(
            level=TestLevel.ADDITIONAL,
            method="getInstance",
            args={String.class}
    ),
    @TestTargetNew(
            level=TestLevel.ADDITIONAL,
            method="validate",
            args={CertPath.class, CertPathParameters.class}
    ),
    @TestTargetNew(
            level=TestLevel.COMPLETE,
            method="method",
            args={}
    )
})
public void testCertPathValidator() throws Exception {
    CertPathValidator certPathValidator = CertPathValidator.getInstance(
            algorithmName);

    CertPathValidatorResult validatorResult = certPathValidator.validate(
            getCertPath(), getParams());

    validateResult(validatorResult);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:27,代码来源:CertPathValidatorTest.java

示例3: engineValidate

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
public CertPathValidatorResult engineValidate(CertPath certPath,
        CertPathParameters params) throws CertPathValidatorException,
        InvalidAlgorithmParameterException {
    ++sw; 
    if (certPath == null) {
        if ((sw % 2) == 0) {
            throw new CertPathValidatorException("certPath null");
        }
    }
    if (params == null) {
        if ((sw % 3) == 0) {
            throw new InvalidAlgorithmParameterException("params null");
        }
    }
    return null;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:MyCertPathValidatorSpi.java

示例4: certPathReview

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
private PKIXCertPathValidatorResult certPathReview(CertPath certPath,
		PKIXParameters params) throws NoSuchAlgorithmException,
		CertPathValidatorException, InvalidAlgorithmParameterException {

	CertPathValidator certPathValidator = CertPathValidator
			.getInstance(CertPathValidator.getDefaultType());
	CertPathValidatorResult result = certPathValidator.validate(certPath,
			params);

	PKIXCertPathValidatorResult pkixResult = (PKIXCertPathValidatorResult) result;

	return pkixResult;

}
 
开发者ID:bluecrystalsign,项目名称:signer-source,代码行数:15,代码来源:CertificateService.java

示例5: validateResult

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
@Override
public void validateResult(CertPathValidatorResult validatorResult) {
    assertNotNull("validator result is null", validatorResult);
    assertTrue("validator result is not PKIX",
            validatorResult instanceof PKIXCertPathValidatorResult);

}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:8,代码来源:CertPathValidatorTestPKIX.java

示例6: engineValidate

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
/**
 * Validates an attribute certificate with the given certificate path.
 * 
 * <p>
 * <code>params</code> must be an instance of
 * <code>ExtendedPKIXParameters</code>.
 * <p>
 * The target constraints in the <code>params</code> must be an
 * <code>X509AttributeCertStoreSelector</code> with at least the attribute
 * certificate criterion set. Obey that also target informations may be
 * necessary to correctly validate this attribute certificate.
 * <p>
 * The attribute certificate issuer must be added to the trusted attribute
 * issuers with {@link ExtendedPKIXParameters#setTrustedACIssuers(Set)}.
 * 
 * @param certPath The certificate path which belongs to the attribute
 *            certificate issuer public key certificate.
 * @param params The PKIX parameters.
 * @return A <code>PKIXCertPathValidatorResult</code> of the result of
 *         validating the <code>certPath</code>.
 * @throws InvalidAlgorithmParameterException if <code>params</code> is
 *             inappropriate for this validator.
 * @throws CertPathValidatorException if the verification fails.
 */
public CertPathValidatorResult engineValidate(CertPath certPath,
    CertPathParameters params) throws CertPathValidatorException,
    InvalidAlgorithmParameterException
{
    if (!(params instanceof ExtendedPKIXParameters))
    {
        throw new InvalidAlgorithmParameterException(
            "Parameters must be a "
                + ExtendedPKIXParameters.class.getName() + " instance.");
    }
    ExtendedPKIXParameters pkixParams = (ExtendedPKIXParameters) params;

    Selector certSelect = pkixParams.getTargetConstraints();
    if (!(certSelect instanceof X509AttributeCertStoreSelector))
    {
        throw new InvalidAlgorithmParameterException(
            "TargetConstraints must be an instance of "
                + X509AttributeCertStoreSelector.class.getName() + " for "
                + this.getClass().getName() + " class.");
    }
    X509AttributeCertificate attrCert = ((X509AttributeCertStoreSelector) certSelect)
        .getAttributeCert();

    CertPath holderCertPath = RFC3281CertPathUtilities.processAttrCert1(attrCert, pkixParams);
    CertPathValidatorResult result = RFC3281CertPathUtilities.processAttrCert2(certPath, pkixParams);
    X509Certificate issuerCert = (X509Certificate) certPath
        .getCertificates().get(0);
    RFC3281CertPathUtilities.processAttrCert3(issuerCert, pkixParams);
    RFC3281CertPathUtilities.processAttrCert4(issuerCert, pkixParams);
    RFC3281CertPathUtilities.processAttrCert5(attrCert, pkixParams);
    // 6 already done in X509AttributeCertStoreSelector
    RFC3281CertPathUtilities.processAttrCert7(attrCert, certPath, holderCertPath, pkixParams);
    RFC3281CertPathUtilities.additionalChecks(attrCert, pkixParams);
    Date date = null;
    try
    {
        date = CertPathValidatorUtilities
            .getValidCertDateFromValidityModel(pkixParams, null, -1);
    }
    catch (AnnotatedException e)
    {
        throw new ExtCertPathValidatorException(
            "Could not get validity date from attribute certificate.", e);
    }
    RFC3281CertPathUtilities.checkCRLs(attrCert, pkixParams, issuerCert, date, certPath.getCertificates());
    return result;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:72,代码来源:PKIXAttrCertPathValidatorSpi.java

示例7: getValidatorResult

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
public CertPathValidatorResult getValidatorResult() {
    return validatorResult;
}
 
开发者ID:lizwjiang,项目名称:cgv,代码行数:4,代码来源:RuleCheckResult.java

示例8: setValidatorResult

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
public void setValidatorResult(CertPathValidatorResult validatorResult) {
    this.validatorResult = validatorResult;
}
 
开发者ID:lizwjiang,项目名称:cgv,代码行数:4,代码来源:RuleCheckResult.java

示例9: validate

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
/**
 * Perform a PKIX validation. On success, print the
 * CertPathValidatorResult on System.out. On failure,
 * throw an exception.
 *
 * @param path CertPath to validate
 * @param params PKIXParameters to use in validation
 * @throws Exception on error
 */
public static void validate(CertPath path, PKIXParameters params)
    throws Exception {
    CertPathValidator validator =
        CertPathValidator.getInstance("PKIX");
    CertPathValidatorResult cpvr = validator.validate(path, params);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:VerifyNameConstraints.java

示例10: validate

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
/**
 * Perform a PKIX validation.
 *
 * @param path CertPath to validate
 * @param params PKIXParameters to use in validation
 * @throws Exception on error
 */
public static void validate(CertPath path, PKIXParameters params)
    throws Exception {
    CertPathValidator validator =
        CertPathValidator.getInstance("PKIX");
    CertPathValidatorResult cpvr = validator.validate(path, params);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:ValidateTargetConstraints.java

示例11: validate

import java.security.cert.CertPathValidatorResult; //导入依赖的package包/类
/**
 * Perform a PKIX validation.
 *
 * @param path CertPath to validate
 * @param params PKIXParameters to use in validation
 * @throws Exception on error
 */
public static void validate(CertPath path, PKIXParameters params)
    throws Exception {
    CertPathValidator validator =
        CertPathValidator.getInstance("PKIX", "SUN");
    CertPathValidatorResult cpvr = validator.validate(path, params);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:ValidateNC.java


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