private void checkInitializedSecuritySystem(String systemPublicKeyBase64) {
logger.info("Checking security system configuration (ensuring that system is using correct key pair)");
String currentPublicKeyBase64 = Base64.encodeBytes(publicKey.getEncoded());
if (!systemPublicKeyBase64.equals(currentPublicKeyBase64)) {
throw new BadSecurityConfigurationException("System property public key differs from currently used, halting");
}
try {
decrypt(encrypt("testString".getBytes()));
} catch (EveManageSecurityException e) {
throw new BadSecurityConfigurationException("Unable to encrypt and decrypt test string, halting");
}
logger.info("Security system is configured correctly");
checkIfUsingDefaultKeys(systemPublicKeyBase64);
}