Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-users] Password Security Encryption for RCPapplication

exactly what I was looking for, works a treat thanks


From: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Guy Pelletier
Sent: Tuesday, 3 March 2009 11:42 PM
To: EclipseLink User Discussions
Subject: Re: [eclipselink-users] Password Security Encryption for RCPapplication

Mi Matt,

You can encrypt it by executing the following code:

import org.eclipse.persistence.internal.security.SecurableObjectHolder;

SecurableObjectHolder holder = new SecurableObjectHolder();
String ePswd = holder.getSecurableObject().encryptPassword("password");       
System.out.println(">>"+ePswd+"<<");


Cut and paste that output to your persistence.xml file and that should do it.

That uses the default internal JCE encryption. If you wanted to go deeper and create your own algorithm, you'd need to set it on the preLogin event, that is:

<property name="eclipselink.session-event-listener" value="CustomizedSessionEventListener"/>

public class CustomizedSessionEventListener extends SessionEventAdapter {
    public CustomizedSessionEventListener() {
        super();
    }

    public void preLogin(SessionEvent event) {
        event.getSession().getLogin().setEncryptionClassName("encryptionClassName");
    }
}

Your encryption class would need to implement the org.eclipse.persistence.internal.security.Securable interface.

Cheers,
Guy

----- Original Message -----
From: Matthew Simcox
To: eclipselink-users@xxxxxxxxxxx
Sent: Monday, March 02, 2009 9:59 PM
Subject: [eclipselink-users] Password Security Encryption for RCP application


Hi,

I have a standalone RCP application which is using eclipselink. Currently I'm in testing however for the production release I need to somehow encrypt the hardcoded password in the persistence.xml file.

Can someone advise how this could be possible?

Regards,

Matt
NOTICE
This e-mail and any attachments are confidential and may contain copyright material of Macquarie Group Limited or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Group Limited does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Group Limited.




_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Back to the top