use of java.security.cert.CertPathValidatorResult in project robovm by robovm.
the class CertPathValidatorTest method testCertPathValidator.
public void testCertPathValidator() throws Exception {
CertPathValidator certPathValidator = CertPathValidator.getInstance(algorithmName);
CertPathValidatorResult validatorResult = certPathValidator.validate(getCertPath(), getParams());
validateResult(validatorResult);
}
use of java.security.cert.CertPathValidatorResult in project robovm by robovm.
the class CertPathValidatorSpiTest method testCertPathValidatorSpi01.
/**
* Test for <code>CertPathValidatorSpi</code> constructor Assertion:
* constructs CertPathValidatorSpi
*/
public void testCertPathValidatorSpi01() throws CertPathValidatorException, InvalidAlgorithmParameterException {
CertPathValidatorSpi certPathValid = new MyCertPathValidatorSpi();
CertPathParameters params = null;
CertPath certPath = null;
CertPathValidatorResult cpvResult = certPathValid.engineValidate(certPath, params);
assertNull("Not null CertPathValidatorResult", cpvResult);
try {
certPathValid.engineValidate(certPath, params);
fail("CertPathValidatorException must be thrown");
} catch (CertPathValidatorException e) {
}
try {
certPathValid.engineValidate(certPath, params);
fail("InvalidAlgorithmParameterException must be thrown");
} catch (InvalidAlgorithmParameterException e) {
}
}
use of java.security.cert.CertPathValidatorResult in project jdk8u_jdk by JetBrains.
the class ValidateTargetConstraints method validate.
/**
* 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);
}
use of java.security.cert.CertPathValidatorResult in project jdk8u_jdk by JetBrains.
the class ValidateNC method validate.
/**
* 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);
}
use of java.security.cert.CertPathValidatorResult in project jdk8u_jdk by JetBrains.
the class VerifyNameConstraints method validate.
/**
* 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);
}
Aggregations