I'm trying to create a set of encryption procedures on db2 v 8.1 using bouncycastle (and java of course)
Actually only the init method is a procedure, the my_encrypt(java.lang.String), my_decrypt(java.lang.String) and my_hash(java.lang.String) routines are all functions.
All static.
I'm developing on XP Pro Db2 v8.1, but deploying on SUSE Linux.
I'm already using bouncycastle successfuly with these methods stored in a 3 class jar included in my project. So I know the algorithm and usage works. I can encrypt Strings and insert the in preparedStatements, decrypt the on the way out.
I want to be able to use statements like:
String query = "update some_table set some_field = my_encrypt(?)"
in a prepared statement.
When I call the my_encrypt_init procedure with the aesKey seed .... db2 just hangs. In fact db2diag.log becomes filled with repeated log messages.
I've tried variations on the BouncyCastle install, putting it in the IBM java/jdk/jre/ext and updating the java.security file. didn't work. Tried the installation by putting the bouncycastle jar in the classpath and "manually" registering it in the init method. Same results. it's when the BouncyCastleProvider is instantiated that the hangup begins.
Yes, I downloaded the US_policy and local_policy jars. this is not the issue, as I said: I've already has success with the algorithms I'm using.
And this is a block from db2diag.log that I get
It repeats this endlessly, I literally have to go into the task manager and kill the process.
Obviously I'm still missing something, I'm still doing something wrong.
Has anybody had success creating such an arrangment?
Actually only the init method is a procedure, the my_encrypt(java.lang.String), my_decrypt(java.lang.String) and my_hash(java.lang.String) routines are all functions.
All static.
I'm developing on XP Pro Db2 v8.1, but deploying on SUSE Linux.
I'm already using bouncycastle successfuly with these methods stored in a 3 class jar included in my project. So I know the algorithm and usage works. I can encrypt Strings and insert the in preparedStatements, decrypt the on the way out.
I want to be able to use statements like:
String query = "update some_table set some_field = my_encrypt(?)"
in a prepared statement.
When I call the my_encrypt_init procedure with the aesKey seed .... db2 just hangs. In fact db2diag.log becomes filled with repeated log messages.
I've tried variations on the BouncyCastle install, putting it in the IBM java/jdk/jre/ext and updating the java.security file. didn't work. Tried the installation by putting the bouncycastle jar in the classpath and "manually" registering it in the init method. Same results. it's when the BouncyCastleProvider is instantiated that the hangup begins.
Yes, I downloaded the US_policy and local_policy jars. this is not the issue, as I said: I've already has success with the algorithms I'm using.
Code:
call sqlj.install_jar('file:C:\workspace\migrator\encryptor-udf\target\encryptor-udf.jar', 'encryptor');
call sqlj.refresh_classes();
COMMIT;
CREATE PROCEDURE ENCRYPTOR_INIT ( IN aesKeyString VARCHAR(64) )
DYNAMIC RESULT SETS 0
LANGUAGE JAVA
PARAMETER STYLE JAVA
EXTERNAL NAME 'com.tsys.prepaid.hcac.migrator.crypto.EncryptorUDF!encryptor_init(java.lang.String)'
MODIFIES SQL DATA
NOT DETERMINISTIC
EXTERNAL ACTION
FENCED NOT THREADSAFE
;
And this is a block from db2diag.log that I get
Code:
2006-08-09-22.52.51.468000-240 I189344H263 LEVEL: Warning
PID : 912 TID : 3472 PROC : db2fmp.exe
INSTANCE: DB2 NODE : 000
FUNCTION: DB2 UDB, oper system services, sqloJVMvfprintf, probe:20
MESSAGE : char[]
2006-08-09-22.52.51.484000-240 I189609H269 LEVEL: Warning
PID : 912 TID : 3472 PROC : db2fmp.exe
INSTANCE: DB2 NODE : 000
FUNCTION: DB2 UDB, oper system services, sqloJVMvfprintf, probe:20
MESSAGE : 0x00a3c180
2006-08-09-22.52.51.515000-240 I189880H263 LEVEL: Warning
PID : 912 TID : 3472 PROC : db2fmp.exe
INSTANCE: DB2 NODE : 000
FUNCTION: DB2 UDB, oper system services, sqloJVMvfprintf, probe:20
MESSAGE : [16]
2006-08-09-22.52.51.531000-240 I190145H263 LEVEL: Warning
PID : 912 TID : 3472 PROC : db2fmp.exe
INSTANCE: DB2 NODE : 000
FUNCTION: DB2 UDB, oper system services, sqloJVMvfprintf, probe:20
MESSAGE : char[]
It repeats this endlessly, I literally have to go into the task manager and kill the process.
Obviously I'm still missing something, I'm still doing something wrong.
Has anybody had success creating such an arrangment?