/** * Check whether the given property should be encrypted or not. * * @param mandatoryProperties mandatory property array * @param propertyName property name * @return returns true if the property should be encrypted */ private boolean isPropertyToBeEncrypted(Property[] mandatoryProperties, String propertyName) { for (Property property : mandatoryProperties) { if (propertyName.equalsIgnoreCase(property.getName())) { return property.getDescription().contains(UserStoreConfigurationConstant.ENCRYPT_TEXT); } } return false; }
/** * Check whether the given property should be encrypted or not. * * @param mandatoryProperties mandatory property array * @param propertyName property name * @return returns true if the property should be encrypted */ private boolean isPropertyToBeEncrypted(Property[] mandatoryProperties, String propertyName) { for (Property property : mandatoryProperties) { if (propertyName.equalsIgnoreCase(property.getName())) { return property.getDescription().contains(UserStoreConfigurationConstant.ENCRYPT_TEXT); } } return false; }
/** * Get the list of properties from mandatoryProperties list * * @param userStoreClass class name of user store * @return ArrayList consisting of mandatory properties to be encrypted */ private static ArrayList<String> getEncryptPropertyList(String userStoreClass) { //First check for mandatory field with #encrypt Property[] mandatoryProperties = UserStoreManagerRegistry.getUserStoreProperties(userStoreClass). getMandatoryProperties(); ArrayList<String> propertyList = new ArrayList<String>(); for (Property property : mandatoryProperties) { if (property != null) { String propertyName = property.getName(); if (propertyName != null && property.getDescription().contains (UserStoreConfigurationConstants.ENCRYPT_TEXT)) { propertyList.add(propertyName); } } } return propertyList; }
/** * Get the list of properties from mandatoryProperties list * * @param userStoreClass class name of user store * @return ArrayList consisting of mandatory properties to be encrypted */ private static ArrayList<String> getEncryptPropertyList(String userStoreClass) { //First check for mandatory field with #encrypt Property[] mandatoryProperties = UserStoreManagerRegistry.getUserStoreProperties(userStoreClass). getMandatoryProperties(); ArrayList<String> propertyList = new ArrayList<String>(); for (Property property : mandatoryProperties) { if (property != null) { String propertyName = property.getName(); if (propertyName != null && property.getDescription().contains (UserStoreConfigurationConstants.ENCRYPT_TEXT)) { propertyList.add(propertyName); } } } return propertyList; }
/** * Get the list of properties from mandatoryProperties list * * @param userStoreClass class name of user store * @return ArrayList consisting of mandatory properties to be encrypted */ private static ArrayList<String> getEncryptPropertyList(String userStoreClass) { //First check for mandatory field with #encrypt Property[] mandatoryProperties = UserStoreManagerRegistry.getUserStoreProperties(userStoreClass). getMandatoryProperties(); ArrayList<String> propertyList = new ArrayList<String>(); for (Property property : mandatoryProperties) { if (property != null) { String propertyName = property.getName(); if (propertyName != null && property.getDescription().contains (UserStoreConfigurationConstants.ENCRYPT_TEXT)) { propertyList.add(propertyName); } } } return propertyList; }
if (UserStoreConfigurationConstant.UNIQUE_ID_CONSTANT.equals(property.getName())) { foundUniqueIDProperty = true; break;
if (UserStoreConfigurationConstant.UNIQUE_ID_CONSTANT.equals(property.getName())) { foundUniqueIDProperty = true; break;
/** * Generate the RandomPassword[] from secondaryRealmConfiguration for given userStoreClass * * @param userStoreClass Extract the mandatory properties of this class * @param randomPhrase The randomly generated keyword which will be stored in * RandomPassword object * @param secondaryRealmConfiguration RealmConfiguration object consists the properties * @return RandomPassword[] array for each property */ private RandomPassword[] getRandomPasswordProperties(String userStoreClass, String randomPhrase, RealmConfiguration secondaryRealmConfiguration) { //First check for mandatory field with #encrypt Property[] mandatoryProperties = getMandatoryProperties(userStoreClass); ArrayList<RandomPassword> randomPasswordArrayList = new ArrayList<RandomPassword>(); for (Property property : mandatoryProperties) { String propertyName = property.getName(); if (property.getDescription().contains(UserStoreConfigurationConstant.ENCRYPT_TEXT)) { RandomPassword randomPassword = new RandomPassword(); randomPassword.setPropertyName(propertyName); randomPassword.setPassword(secondaryRealmConfiguration.getUserStoreProperty(propertyName)); randomPassword.setRandomPhrase(randomPhrase); randomPasswordArrayList.add(randomPassword); } } return randomPasswordArrayList.toArray(new RandomPassword[randomPasswordArrayList.size()]); }
/** * Generate the RandomPassword[] from secondaryRealmConfiguration for given userStoreClass * * @param userStoreClass Extract the mandatory properties of this class * @param randomPhrase The randomly generated keyword which will be stored in * RandomPassword object * @param secondaryRealmConfiguration RealmConfiguration object consists the properties * @return RandomPassword[] array for each property */ private RandomPassword[] getRandomPasswordProperties(String userStoreClass, String randomPhrase, RealmConfiguration secondaryRealmConfiguration) { //First check for mandatory field with #encrypt Property[] mandatoryProperties = getMandatoryProperties(userStoreClass); ArrayList<RandomPassword> randomPasswordArrayList = new ArrayList<RandomPassword>(); for (Property property : mandatoryProperties) { String propertyName = property.getName(); if (property.getDescription().contains(UserStoreConfigurationConstant.ENCRYPT_TEXT)) { RandomPassword randomPassword = new RandomPassword(); randomPassword.setPropertyName(propertyName); randomPassword.setPassword(secondaryRealmConfiguration.getUserStoreProperty(propertyName)); randomPassword.setRandomPhrase(randomPhrase); randomPasswordArrayList.add(randomPassword); } } return randomPasswordArrayList.toArray(new RandomPassword[randomPasswordArrayList.size()]); }