Menu

#26 ResourceBundles - Multilingual properties Encryption

jasypt 1.3
open
3
2014-09-29
2014-09-29
No

Hi Daniel,

love the tool so simple to use! Just discovered it yesterday and wow...

Anyway - I see how to use it with properties but how can we use it with ResourceBundles?

I have a multilingual application (i18n) where all the strings are in ResourceBundle files and copyrighted strings (yes, some of the strings are used under copyright licence) need to be encrypted across all languages.

I've completed the ToENC, but can't get the FromENC to work...

Many thanks and best regards
Seán

PS this is a relatively urgent requirement, we're supposed to release next week...

PPS on page http://www.jasypt.org/encrypting-configuration.html shouldn't the line

Properties props = new EncryptableProperties(encryptor);

actually be

EncryptableProperties props = new EncryptableProperties(encryptor);

Related

Feature Requests: #26

Discussion

  • Daniel Fernandez

    We don't have any direct integration class for the ResourceBundle interface... but I at first thought I think it should be quite easy to create an implementation with almost the same code as the existing java.util.PropertyResourceBundle, modifying what's done in the constructor of this class:

    public PropertyResourceBundle (InputStream stream) throws IOException {
        Properties properties = new Properties();
        properties.load(stream);
        lookup = new HashMap(properties);
    }
    

    ...so that, intead of creating a "new Properties()" object, you create an "EncryptableProperties" one. Note that jasypt's "EncryptableProperties" class extends from java.util.Properties, so the rest of the code should work just fine.

    About that line in the doc... that's correct, because, as said, EncryptableProperties is just a subclass of Properties.

     
    • Seán McPoland

      Seán McPoland - 2014-09-29

      Thanks Daniel,

      you've lost me there, I'm not a java guru like you, In-fact I've only just
      learnt java in the last two months...

      Anyway - something to think about as a leading feature that no-one else can
      do and, of course, a real example of how this could work (also to be
      published on the web). At your convenience of course.

      Thanks for your time and very swift response.

      regards

      On 29 September 2014 11:20, Daniel Fernandez dfernandez@users.sf.net
      wrote:

      We don't have any direct integration class for the ResourceBundle
      interface... but I at first thought I think it should be quite easy to
      create an implementation with almost the same code as the existing
      java.util.PropertyResourceBundle, modifying what's done in the constructor
      of this class:

      public PropertyResourceBundle (InputStream stream) throws IOException {
      Properties properties = new Properties();
      properties.load(stream);
      lookup = new HashMap(properties);}

      ...so that, intead of creating a "new Properties()" object, you create an
      "EncryptableProperties" one. Note that jasypt's "EncryptableProperties"
      class extends from java.util.Properties, so the rest of the code should
      work just fine.

      About that line in the doc... that's correct, because, as said,
      EncryptableProperties is just a subclass of Properties.


      Status: open
      Group: jasypt 1.3
      Labels: ResourceBundle
      Created: Mon Sep 29, 2014 07:15 AM UTC by Seán McPoland
      Last Updated: Mon Sep 29, 2014 07:15 AM UTC
      Owner: Daniel Fernandez

      Hi Daniel,

      love the tool so simple to use! Just discovered it yesterday and wow...

      Anyway - I see how to use it with properties but how can we use it with
      ResourceBundles?

      I have a multilingual application (i18n) where all the strings are in
      ResourceBundle files and copyrighted strings (yes, some of the strings are
      used under copyright licence) need to be encrypted across all languages.

      I've completed the ToENC, but can't get the FromENC to work...

      Many thanks and best regards
      Seán

      PS this is a relatively urgent requirement, we're supposed to release
      next week...

      PPS on page http://www.jasypt.org/encrypting-configuration.html
      shouldn't the line

      Properties props = new EncryptableProperties(encryptor);

      actually be

      EncryptableProperties props = new EncryptableProperties(encryptor);


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/jasypt/feature-requests/26/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #26

  • Seán McPoland

    Seán McPoland - 2014-09-29

    Thanks Daniel,

    you've lost me there, I'm not a java guru like you, In-fact I've only just learnt java in the last two months...

    Anyway - something to think about as a leading feature that no-one else can do and, of course, a real example of how this could work (also to be published on the web). At your convenience of course.

    Thanks for your time and very swift response.

    regards

     

Log in to post a comment.