Exemplo n.º 1
0
 static Instance getInstance(String type, Class<?> clazz, String algorithm, Provider provider)
     throws NoSuchAlgorithmException {
   Service s = GetInstance.getService(type, algorithm, provider);
   Exception ve = JceSecurity.getVerificationResult(provider);
   if (ve != null) {
     String msg = "JCE cannot authenticate the provider " + provider.getName();
     throw new SecurityException(msg, ve);
   }
   return GetInstance.getInstance(s, clazz);
 }
Exemplo n.º 2
0
 static Instance getInstance(String type, Class<?> clazz, String algorithm, String provider)
     throws NoSuchAlgorithmException, NoSuchProviderException {
   Service s = GetInstance.getService(type, algorithm, provider);
   Exception ve = getVerificationResult(s.getProvider());
   if (ve != null) {
     String msg = "JCE cannot authenticate the provider " + provider;
     throw (NoSuchProviderException) new NoSuchProviderException(msg).initCause(ve);
   }
   return GetInstance.getInstance(s, clazz);
 }