If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Issues while connectinG to database using DATA_ENCRYPT

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-01-10, 01:07
SUSHMA50 SUSHMA50 is offline
Registered User
 
Join Date: Dec 2009
Posts: 10
Issues while connectinG to database using DATA_ENCRYPT

Hi,
I am using the foolowig piece of code to connect to the database. The database has the Authentication type defined as DATA_ENCRYPT.

Class.forName("com.ibm.db2.jcc.DB2Driver");
final Properties properties = new Properties();
properties.put("user", "XXXXXXXX");
properties.put("password", "XXXXXXX");
properties
.put(
"securityMechanism",
new String(
""
+ com.ibm.db2.jcc.DB2BaseDataSource.ENCRYPTED_USER_A ND_DATA_SECURITY
+ ""));
final String url = "jdbc:db2://<IP Address>:<port>/<database name>";
final Connection conn = DriverManager
.getConnection(url, properties);



However when I try to run this code I am getting the follwoing errors

com.ibm.db2.jcc.am.SqlException: [jcc][1071][10615][3.58.82] Caught java.security.InvalidAlgorithmParameterException while initializing EncryptionManager. See attached Throwable for details. ERRORCODE=-4223, SQLSTATE=null
at com.ibm.db2.jcc.am.ed.a(ed.java:660)
at com.ibm.db2.jcc.am.ed.a(ed.java:60)
at com.ibm.db2.jcc.am.ed.a(ed.java:85)
at com.ibm.db2.jcc.am.pc.a(pc.java:152)
at com.ibm.db2.jcc.t4.b.Zc(b.java:2427)
at com.ibm.db2.jcc.t4.b.c(b.java:727)
at com.ibm.db2.jcc.t4.b.b(b.java:686)
at com.ibm.db2.jcc.t4.b.a(b.java:367)
at com.ibm.db2.jcc.t4.b.<init>(b.java:307)
at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection( DB2SimpleDataSource.java:214)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:4 56)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at JDBCConnectivity.EncryptionConnectivity.main(Encry ptionConnectivity.java:40)
Caused by: java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 512 to 1024 (inclusive)
at com.sun.crypto.provider.DHKeyPairGenerator.initial ize(DashoA12275)
at java.security.KeyPairGenerator$Delegate.initialize (Unknown Source)
at java.security.KeyPairGenerator.initialize(Unknown Source)
at com.ibm.db2.jcc.am.pc.a(pc.java:141)
... 10 more


Can someone kindly suggest me if I am missing something

Regards
Siddharth Shah
Reply With Quote
  #2 (permalink)  
Old 02-01-10, 05:54
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
Hi,

let's start with the obvious:

There's a blank in
ENCRYPTED_USER_A ND_DATA_SECURITY

If it's in your source-code aswell, you might have your solution.

nvk
Reply With Quote
  #3 (permalink)  
Old 02-01-10, 08:32
SUSHMA50 SUSHMA50 is offline
Registered User
 
Join Date: Dec 2009
Posts: 10
Hi,
I have introduced a space in the post by mistake.

Regards
Siddharth Shah
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On