38 |
package java.security; |
package java.security; |
39 |
|
|
40 |
import java.security.cert.Certificate; |
import java.security.cert.Certificate; |
|
import java.security.cert.CertificateException; |
|
41 |
import java.security.cert.X509Certificate; |
import java.security.cert.X509Certificate; |
42 |
import java.security.spec.AlgorithmParameterSpec; |
import java.security.spec.AlgorithmParameterSpec; |
43 |
|
|
246 |
} |
} |
247 |
catch (java.lang.reflect.InvocationTargetException ite) |
catch (java.lang.reflect.InvocationTargetException ite) |
248 |
{ |
{ |
249 |
throw new NoSuchAlgorithmException(algorithm); |
throw new NoSuchAlgorithmException(algorithm); |
250 |
} |
} |
251 |
|
|
252 |
if (o instanceof SignatureSpi) |
if (o instanceof SignatureSpi) |
318 |
throw new InvalidKeyException( |
throw new InvalidKeyException( |
319 |
"KeyUsage of this Certificate indicates it cannot be used for digital signing"); |
"KeyUsage of this Certificate indicates it cannot be used for digital signing"); |
320 |
} |
} |
321 |
try |
this.initVerify(certificate.getPublicKey()); |
|
{ |
|
|
this.initVerify(certificate.getPublicKey()); |
|
|
} |
|
|
catch (SignatureException se) |
|
|
{ |
|
|
throw new InvalidKeyException(se.getMessage()); |
|
|
} |
|
|
catch (NoSuchAlgorithmException nsae) |
|
|
{ |
|
|
throw new InvalidKeyException(nsae.getMessage()); |
|
|
} |
|
|
catch (NoSuchProviderException nspe) |
|
|
{ |
|
|
throw new InvalidKeyException(nspe.getMessage()); |
|
|
} |
|
|
catch (CertificateException ce) |
|
|
{ |
|
|
throw new InvalidKeyException(ce.getMessage()); |
|
|
} |
|
322 |
} |
} |
323 |
|
|
324 |
/** |
/** |