查下JDK文档可以很清楚拉,大多数是用AWT和SWING下的方法,但是有一个不知道有没有注意就是java.security.cert.CertPathValidator.validate(java.security.cert.CertPath, java.security.cert.CertPathParameters) 看看这个方法:validate public final CertPathValidatorResult validate(CertPath certPath, CertPathParameters params) throws CertPathValidatorException, InvalidAlgorithmParameterException Validates the specified certification path using the specified algorithm parameter set. The CertPath specified must be of a type that is supported by the validation algorithm, otherwise an InvalidAlgorithmParameterException will be thrown. For example, a CertPathValidator that implements the PKIX algorithm validates CertPath objects of type X.509. Parameters: certPath - the CertPath to be validated params - the algorithm parameters Returns: the result of the validation algorithm Throws: CertPathValidatorException - if the CertPath does not validate InvalidAlgorithmParameterException - if the specified parameters or the type of the specified CertPath are inappropriate for this CertPathValidator
看看这个方法:validate
public final CertPathValidatorResult validate(CertPath certPath,
CertPathParameters params)
throws CertPathValidatorException,
InvalidAlgorithmParameterException
Validates the specified certification path using the specified algorithm parameter set.
The CertPath specified must be of a type that is supported by the validation algorithm, otherwise an InvalidAlgorithmParameterException will be thrown. For example, a CertPathValidator that implements the PKIX algorithm validates CertPath objects of type X.509.
Parameters:
certPath - the CertPath to be validated
params - the algorithm parameters
Returns:
the result of the validation algorithm
Throws:
CertPathValidatorException - if the CertPath does not validate
InvalidAlgorithmParameterException - if the specified parameters or the type of the specified CertPath are inappropriate for this CertPathValidator