View Javadoc
1 package jsdsi; 2 3 import java.security.GeneralSecurityException; 4 import java.security.InvalidAlgorithmParameterException; 5 import java.security.cert.CertPathValidatorException; 6 import java.security.cert.CertPathValidatorSpi; 7 8 /*** 9 * Checks whether a certification path satisfies certain parameters: 10 * essentially a wrapper around Proof.verify(). 11 * 12 * @see Proof 13 * 14 * @author Sameer Ajmani 15 * @version $Revision: 1.1.6.1 $ $Date: 2005/11/08 03:12:52 $ 16 */ 17 public class CertPathValidator extends CertPathValidatorSpi { 18 /*** 19 * @see java.security.cert.CertPathValidatorSpi#engineValidate(CertPath, CertPathParameters) 20 */ 21 public java.security.cert.CertPathValidatorResult engineValidate( 22 java.security.cert.CertPath path, 23 java.security.cert.CertPathParameters params) 24 throws CertPathValidatorException, InvalidAlgorithmParameterException { 25 try { 26 return engineValidate((jsdsi.CertPath) path, 27 (jsdsi.CertPathParameters) params); 28 } catch (ClassCastException e) { 29 throw (InvalidAlgorithmParameterException) 30 new InvalidAlgorithmParameterException().initCause(e); 31 } 32 } 33 34 /*** 35 * @see java.security.cert.CertPathValidatorSpi#engineValidate(CertPath, CertPathParameters) 36 */ 37 public jsdsi.CertPathValidatorResult engineValidate( 38 jsdsi.CertPath path, 39 jsdsi.CertPathParameters params) 40 throws CertPathValidatorException, InvalidAlgorithmParameterException { 41 if (!path.getProof().getCert().implies(params.getCert())) { 42 throw new CertPathValidatorException 43 ("param cert does not match or imply proof cert"); 44 } 45 46 try { 47 path.getProof().verify(); 48 return new jsdsi.CertPathValidatorResult(null); 49 } catch (GeneralSecurityException e) { 50 return new jsdsi.CertPathValidatorResult(e); 51 } 52 } 53 }

This page was automatically generated by Maven