aspose file tools*
The moose likes JBoss/WildFly and the fly likes Plugin for Decrypting Data Source Passwords in Jboss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Plugin for Decrypting Data Source Passwords in Jboss" Watch "Plugin for Decrypting Data Source Passwords in Jboss" New topic
Author

Plugin for Decrypting Data Source Passwords in Jboss

P Lavti
Ranch Hand

Joined: Mar 27, 2007
Posts: 65
hi,

I am using Jboss4.0.4 GA server and My SQL as DB.
I can not not use cleartext password in mysql-ds.xml.

I have my own encryption and decryption API for the same.

Could you please let me know how to write an plugin for Jboss which will use my decryption API to decrypt the data source password and provide me the connection pooling for MySQL.

Thanks!


-P Lavti<br />SCJP 5.0 (88%)
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9318
    
109

Originally posted by P Lavti:


I am using Jboss4.0.4 GA server and My SQL as DB.
I can not not use cleartext password in mysql-ds.xml.

I have my own encryption and decryption API for the same.



Actually, JBoss provides a way to encrypt your datasource passwords. Have a look at EncryptingDataSourcePasswords


[My Blog] [JavaRanch Journal]
P Lavti
Ranch Hand

Joined: Mar 27, 2007
Posts: 65
Yes, I ahve already gone thru this.

But I need to use my own encryption-decryption algorithms.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5778
    
    7

Use the same mechanism, but write your own login module using the SecureIdentityLoginModule as a template. It is the login module that employs the en/decryption algorithms.


JBoss In Action
P Lavti
Ranch Hand

Joined: Mar 27, 2007
Posts: 65
Thanks Peter.

I tried it using the SecureIdentityLoginModule as template for my class, and its working fine as well.

The only issue is I need to keep my custom class also in the same package "org.jboss.resource.security" else i'll get compiler error. I am not sure if its acceptable. Any suggetions!!!

Thanks!
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9318
    
109

Originally posted by P Lavti:



The only issue is I need to keep my custom class also in the same package "org.jboss.resource.security" else i'll get compiler error. I am not sure if its acceptable. Any suggetions!!!



What error do you get? Can you post it? Is it a compiler error or a classloader error (when JBoss is starting)?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5778
    
    7

There is no problem with keeping your class in that same package - but you should package your class in your own jar.
P Lavti
Ranch Hand

Joined: Mar 27, 2007
Posts: 65
Originally posted by Jaikiran Pai:


What error do you get? Can you post it? Is it a compiler error or a classloader error (when JBoss is starting)?


For the import of org.jboss.resource.security.SubjectActions, I get the compiler error "The type org.jboss.resource.security.SubjectActions is not visible", since SubjectActions has visibility only within the package. By keeping my custome class in package "org.jboss.resource.security" removes the error.

Originally posted by Peter Johnson:


There is no problem with keeping your class in that same package - but you should package your class in your own jar.


I have kept it in my own jar

Thanks!
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9318
    
109

Originally posted by Peter Johnson:
There is no problem with keeping your class in that same package - but you should package your class in your own jar.


I don't exactly know how the licenses work, but I always thought, creating your own class under the org.jboss package wasn't (legally) allowed. Isn't that the case?
P Lavti
Ranch Hand

Joined: Mar 27, 2007
Posts: 65
This is what actually my next question was.

Having my custom class in the same package and then using it in production, Is it legal?

If not, then what kind off licencing formalities are required?

Otherwise I need write complete login module itself.

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Plugin for Decrypting Data Source Passwords in Jboss
 
Similar Threads
Encryption and Decryption - DB2 and JPA
How to Configuring mysql db with JPA aplication?
Error installing to Parse: name=vfs: server/default/deploy/mysql-ds.xml state=PreParse mode=Manual r
Store JDBC connection password
Best'n easy app server