private static XMLSignatureFactory getXMLSignatureFactory() { XMLSignatureFactory xsf = null; try { xsf = XMLSignatureFactory.getInstance("DOM", "ApacheXMLDSig"); } catch (NoSuchProviderException ex) { try { xsf = XMLSignatureFactory.getInstance("DOM"); } catch (Exception err) { throw new RuntimeException(logger.couldNotCreateInstance("DOM", err)); } } return xsf; }
private static XMLSignatureFactory getXMLSignatureFactory() { XMLSignatureFactory xsf = null; try { xsf = XMLSignatureFactory.getInstance("DOM", "ApacheXMLDSig"); } catch (NoSuchProviderException ex) { try { xsf = XMLSignatureFactory.getInstance("DOM"); } catch (Exception err) { throw new RuntimeException(logger.couldNotCreateInstance("DOM", err)); } } return xsf; }
private static XMLSignatureFactory getXMLSignatureFactory() { XMLSignatureFactory xsf = null; try { xsf = XMLSignatureFactory.getInstance("DOM", "ApacheXMLDSig"); } catch (NoSuchProviderException ex) { try { xsf = XMLSignatureFactory.getInstance("DOM"); } catch (Exception err) { throw new RuntimeException(logger.couldNotCreateInstance("DOM", err)); } } return xsf; }
public static SAML2HandlerChain createChain(String fqn) throws ProcessingException { if (fqn == null) throw logger.nullArgumentError("fqn"); Class<?> clazz = SecurityActions.loadClass(SAML2HandlerChainFactory.class, fqn); if (clazz == null) throw logger.classNotLoadedError(fqn); try { return (SAML2HandlerChain) clazz.newInstance(); } catch (Exception e) { throw logger.couldNotCreateInstance(fqn, e); } } }
/** * Set the {@link SAMLConfigurationProvider} fqn * * @param cp fqn of a {@link SAMLConfigurationProvider} */ public void setConfigProvider(String cp) { if (cp == null) { throw logger.nullArgumentError("configProvider"); } Class<?> clazz = SecurityActions.loadClass(getClass(), cp); if (clazz == null) { throw new RuntimeException(logger.classNotLoadedError(cp)); } try { configProvider = (SAMLConfigurationProvider) clazz.newInstance(); } catch (Exception e) { throw new RuntimeException(logger.couldNotCreateInstance(cp, e)); } }
/** * Set the {@link SAMLConfigurationProvider} fqn * * @param cp fqn of a {@link SAMLConfigurationProvider} */ public void setConfigProvider(String cp) { if (cp == null) { throw logger.nullArgumentError("configProvider"); } Class<?> clazz = SecurityActions.loadClass(getClass(), cp); if (clazz == null) { throw new RuntimeException(logger.classNotLoadedError(cp)); } try { configProvider = (SAMLConfigurationProvider) clazz.newInstance(); } catch (Exception e) { throw new RuntimeException(logger.couldNotCreateInstance(cp, e)); } }
/** * Set the {@link SAMLConfigurationProvider} fqn * * @param cp fqn of a {@link SAMLConfigurationProvider} */ public void setConfigProvider(String cp) { if (cp == null) { throw logger.nullArgumentError("configProvider"); } Class<?> clazz = SecurityActions.loadClass(getClass(), cp); if (clazz == null) { throw new RuntimeException(logger.classNotLoadedError(cp)); } try { configProvider = (SAMLConfigurationProvider) clazz.newInstance(); } catch (Exception e) { throw new RuntimeException(logger.couldNotCreateInstance(cp, e)); } }
/** * <p> * Constructs and returns a {@code SecurityTokenProvider} from the specified class name. * </p> * * @param providerClass the FQN of the {@code SecurityTokenProvider} to be instantiated. * @param properties a {@code Map<String, String>} containing the properties that have been configured for the * token * provider. * * @return a reference to the constructed {@code SecurityTokenProvider} object. */ public SecurityTokenProvider createTokenProvider(String providerClass, Map<String, String> properties) { try { Class<?> clazz = SecurityActions.loadClass(getClass(), providerClass); if (clazz == null) throw logger.classNotLoadedError(providerClass); SecurityTokenProvider tokenProvider = (SecurityTokenProvider) clazz.newInstance(); tokenProvider.initialize(properties); return tokenProvider; } catch (Exception pae) { throw new RuntimeException(logger.couldNotCreateInstance(providerClass, pae)); } }
public static SAML2HandlerChain createChain(String fqn) throws ProcessingException { if (fqn == null) throw logger.nullArgumentError("fqn"); Class<?> clazz = SecurityActions.loadClass(SAML2HandlerChainFactory.class, fqn); if (clazz == null) throw logger.classNotLoadedError(fqn); try { return (SAML2HandlerChain) clazz.newInstance(); } catch (Exception e) { throw logger.couldNotCreateInstance(fqn, e); } } }
/** * <p> * Constructs and returns a {@code ClaimsProcessor} from the specified class name. The processor is initialized with * the * specified properties map. * </p> * * @param processorClass the FQN of the {@code ClaimsProcessor} to be instantiated. * @param properties a {@code Map<String, String>} containing the properties that have been configured for the * claims * processor. * * @return a reference to the constructed {@code ClaimsProcessor} object. */ public ClaimsProcessor createClaimsProcessor(String processorClass, Map<String, String> properties) { try { Class<?> clazz = SecurityActions.loadClass(getClass(), processorClass); if (clazz == null) throw logger.classNotLoadedError(processorClass); ClaimsProcessor claimsProcessor = (ClaimsProcessor) clazz.newInstance(); claimsProcessor.initialize(properties); return claimsProcessor; } catch (Exception pae) { throw new RuntimeException(logger.couldNotCreateInstance("claims processor " + processorClass, pae)); } } }
/** * <p> * Constructs and returns a {@code SecurityTokenProvider} from the specified class name. * </p> * * @param providerClass the FQN of the {@code SecurityTokenProvider} to be instantiated. * @param properties a {@code Map<String, String>} containing the properties that have been configured for the * token * provider. * * @return a reference to the constructed {@code SecurityTokenProvider} object. */ public SecurityTokenProvider createTokenProvider(String providerClass, Map<String, String> properties) { try { Class<?> clazz = SecurityActions.loadClass(getClass(), providerClass); if (clazz == null) throw logger.classNotLoadedError(providerClass); SecurityTokenProvider tokenProvider = (SecurityTokenProvider) clazz.newInstance(); tokenProvider.initialize(properties); return tokenProvider; } catch (Exception pae) { throw new RuntimeException(logger.couldNotCreateInstance(providerClass, pae)); } }
/** * <p> * Constructs and returns a {@code ClaimsProcessor} from the specified class name. The processor is initialized with * the * specified properties map. * </p> * * @param processorClass the FQN of the {@code ClaimsProcessor} to be instantiated. * @param properties a {@code Map<String, String>} containing the properties that have been configured for the * claims * processor. * * @return a reference to the constructed {@code ClaimsProcessor} object. */ public ClaimsProcessor createClaimsProcessor(String processorClass, Map<String, String> properties) { try { Class<?> clazz = SecurityActions.loadClass(getClass(), processorClass); if (clazz == null) throw logger.classNotLoadedError(processorClass); ClaimsProcessor claimsProcessor = (ClaimsProcessor) clazz.newInstance(); claimsProcessor.initialize(properties); return claimsProcessor; } catch (Exception pae) { throw new RuntimeException(logger.couldNotCreateInstance("claims processor " + processorClass, pae)); } } }