List of usage examples for org.apache.wicket.util.crypt NoCrypt NoCrypt
public NoCrypt()
From source file:com.servoy.j2db.server.headlessclient.CachingKeyInSessionSunJceCryptFactory.java
License:Open Source License
public ICrypt newCrypt() { ICrypt crypt = null;/*from ww w . j a v a 2s .c om*/ WebClientSession webClientSession = null; if (Session.exists()) { webClientSession = WebClientSession.get(); crypt = webClientSession.getCrypt(); } if (crypt == null) { WebRequestCycle rc = (WebRequestCycle) RequestCycle.get(); // get http session, create if necessary HttpSession session = rc.getWebRequest().getHttpServletRequest().getSession(true); // retrieve or generate encryption key from session final String keyAttr = rc.getApplication().getApplicationKey() + "." + getClass().getName(); String key = (String) session.getAttribute(keyAttr); if (key == null) { // generate new key key = session.getId() + "." + UUID.randomUUID().toString(); session.setAttribute(keyAttr, key); } // build the crypt based on session key try { crypt = new CachingSunJceCrypt(key); } catch (GeneralSecurityException e) { Debug.error("couldn't generate the crypt class", e); return new NoCrypt(); } if (webClientSession != null) { webClientSession.setCrypt(crypt); } } return crypt; }
From source file:org.geoserver.web.GeoServerCryptProvider.java
License:Open Source License
@Override public ICrypt get() { // fully dynamic lookup as I'm not sure if this method gets called // before or after the application gets its app contxt if (manager.isEncryptingUrlParams()) { return getCrypt(); } else {/*from ww w . java 2 s .c o m*/ return new NoCrypt(); } }