/** * Initializes (or re-initializes) the {@link EncryptorService} by reading the configured * encryption key file. */ public static void initEncryptionService() { File encryptionKey = getEncryptionFile(); if (encryptionKey == null) { encryptionService = null; } else { encryptionService = new EncryptorService(encryptionKey); try { encryptionService.encrypt(ENCRYPTION_PREFIX); } catch (Exception e) { throw new LocalizableValidationException(e, "Error validating the encryption key!", "common.encryption.file.validation"); } } }
/** * Initializes (or re-initializes) the {@link EncryptorService} by reading the configured * encryption key file. */ public static void initEncryptionService() { File encryptionKey = getEncryptionFile(); if (encryptionKey == null) { encryptionService = null; } else { encryptionService = new EncryptorService(encryptionKey); try { encryptionService.encrypt(ENCRYPTION_PREFIX); } catch (Exception e) { throw new LocalizableValidationException(e, "Error validating the encryption key!", "common.encryption.file.validation"); } } }