private String attemptEncryption ( String key , String property ) { try { if ( StringUtils . endsWithIgnoreCase ( key , UNENCRYPTED_SUFFIX ) ) { if ( encryptionProvider == null ) throw new RuntimeCryptoException ( "No encryption provider configured" ) ; return encryptionProvider . encrypt ( property ) ; } else { return property ; } } catch ( MissingParameterException mpre ) { throw new RuntimeCryptoException ( "No value to decrypt specified." ) ; } }
Utility method which will determine if a requested property needs to be encrypted . If property key ends in - unencrypted and the encryption provider is configured this method will return the encrypted property value . If the key does not include - unencrypted then the property value will be returned .