/** * @see org.apache.wicket.util.crypt.ICryptFactory#newCrypt() */ public final ICrypt newCrypt() { if (cache == null) { cache = delegate.newCrypt(); } return cache; } }
@Override public final ICrypt newCrypt() { if (cache == null) { cache = delegate.newCrypt(); } return cache; } }
/** * @see org.apache.wicket.util.crypt.ICryptFactory#newCrypt() */ public final ICrypt newCrypt() { if (cache == null) { cache = delegate.newCrypt(); } return cache; } }
/** * Encrypt with {@link org.apache.wicket.settings.SecuritySettings#getCryptFactory()}. * <p> * <strong>Important</strong>: Encryption is done with {@link org.apache.wicket.settings.SecuritySettings#DEFAULT_ENCRYPTION_KEY} if you haven't * configured an alternative {@link ICryptFactory}. For better security it is recommended to use * {@link CryptoMapper#CryptoMapper(IRequestMapper, Supplier)} with a specific {@link ICrypt} implementation * that generates a separate key for each user. * {@link org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory} provides such an implementation that stores the * key in the HTTP session. * </p> * * @param wrappedMapper * the non-crypted request mapper * @param application * the current application * @see org.apache.wicket.util.crypt.SunJceCrypt */ public CryptoMapper(final IRequestMapper wrappedMapper, final Application application) { this(wrappedMapper, () -> application.getSecuritySettings().getCryptFactory().newCrypt()); }
/** * Encrypt with {@link org.apache.wicket.settings.SecuritySettings#getCryptFactory()}. * <p> * <strong>Important</strong>: Encryption is done with {@link org.apache.wicket.settings.SecuritySettings#DEFAULT_ENCRYPTION_KEY} if you haven't * configured an alternative {@link ICryptFactory}. For better security it is recommended to use * {@link CryptoMapper#CryptoMapper(IRequestMapper, Supplier)} with a specific {@link ICrypt} implementation * that generates a separate key for each user. * {@link org.apache.wicket.core.util.crypt.KeyInSessionSunJceCryptFactory} provides such an implementation that stores the * key in the HTTP session. * </p> * * @param wrappedMapper * the non-crypted request mapper * @param application * the current application * @see org.apache.wicket.util.crypt.SunJceCrypt */ public CryptoMapper(final IRequestMapper wrappedMapper, final Application application) { this(wrappedMapper, () -> application.getSecuritySettings().getCryptFactory().newCrypt()); }
private ICrypt getCrypt() { // lazy init via double checked locking (with volatile, should be safe) // because we cannot get to the settings untile after the whole app startup is done if (theCrypt == null) { synchronized (this) { if (theCrypt == null) { GeoServerApplication application = GeoServerApplication.get(); theCrypt = application.getSecuritySettings().getCryptFactory().newCrypt(); } } } return theCrypt; } }
ICrypt urlCrypt = Application.get().getSecuritySettings().getCryptFactory().newCrypt(); if (urlCrypt != null)
.getSecuritySettings() .getCryptFactory() .newCrypt();
ICrypt urlCrypt = Application.get().getSecuritySettings().getCryptFactory().newCrypt(); if (urlCrypt != null)