206 |
{ |
{ |
207 |
if (provider == null || provider.length() == 0) |
if (provider == null || provider.length() == 0) |
208 |
throw new IllegalArgumentException("Illegal provider"); |
throw new IllegalArgumentException("Illegal provider"); |
209 |
|
|
210 |
Provider p = Security.getProvider(provider); |
Provider p = Security.getProvider(provider); |
211 |
if (p == null) |
if (p == null) |
212 |
throw new NoSuchProviderException(provider); |
throw new NoSuchProviderException(provider); |
251 |
|
|
252 |
if (o instanceof SignatureSpi) |
if (o instanceof SignatureSpi) |
253 |
{ |
{ |
254 |
result = new DummySignature((SignatureSpi) o, algorithm); |
result = new DummySignature((SignatureSpi) o, algorithm); |
255 |
} |
} |
256 |
else if (o instanceof Signature) |
else if (o instanceof Signature) |
257 |
{ |
{ |
258 |
result = (Signature) o; |
result = (Signature) o; |
259 |
result.algorithm = algorithm; |
result.algorithm = algorithm; |
260 |
} |
} |
261 |
else |
else |
262 |
{ |
{ |
263 |
throw new NoSuchAlgorithmException(algorithm); |
throw new NoSuchAlgorithmException(algorithm); |
264 |
} |
} |
265 |
result.provider = provider; |
result.provider = provider; |
266 |
return result; |
return result; |
313 |
if (certificate.getType().equals("X509")) |
if (certificate.getType().equals("X509")) |
314 |
{ |
{ |
315 |
X509Certificate cert = (X509Certificate) certificate; |
X509Certificate cert = (X509Certificate) certificate; |
316 |
boolean[]array = cert.getKeyUsage(); |
boolean[]array = cert.getKeyUsage(); |
317 |
if (array != null && array[0] == false) |
if (array != null && array[0] == false) |
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 |
this.initVerify(certificate.getPublicKey()); |
this.initVerify(certificate.getPublicKey()); |
627 |
*/ |
*/ |
628 |
public Object clone() throws CloneNotSupportedException |
public Object clone() throws CloneNotSupportedException |
629 |
{ |
{ |
630 |
throw new CloneNotSupportedException(); |
return super.clone(); |
631 |
} |
} |
632 |
} |
} |