com.avaje.ebean.config.dbplatform
Class Oracle10DbEncrypt

java.lang.Object
  extended by com.avaje.ebean.config.dbplatform.AbstractDbEncrypt
      extended by com.avaje.ebean.config.dbplatform.Oracle10DbEncrypt
All Implemented Interfaces:
DbEncrypt

public class Oracle10DbEncrypt
extends AbstractDbEncrypt

Oracle encryption support.

You will typically need to create your own encryption and decryption functions similar to the example ones below.

 
  // Remember your DB user needs execute privilege on DBMS_CRYPTO 
  // as well as your encryption and decryption functions
  
  
  // This is an Example Encryption function only - please create your own.
 
 CREATE OR REPLACE FUNCTION eb_encrypt(data IN VARCHAR, key in VARCHAR) RETURN RAW IS
 
     encryption_mode NUMBER := DBMS_CRYPTO.ENCRYPT_AES128 + DBMS_CRYPTO.CHAIN_CBC  + DBMS_CRYPTO.PAD_PKCS5;
 
     BEGIN
          RETURN DBMS_CRYPTO.ENCRYPT(UTL_I18N.STRING_TO_RAW (data, 'AL32UTF8'), 
            encryption_mode, UTL_I18N.STRING_TO_RAW(key, 'AL32UTF8') );
     END;
     /
     
     
     
  // This is an Example Decryption function only - please create your own.
     
 CREATE OR REPLACE FUNCTION eb_decrypt(data IN RAW, key IN VARCHAR) RETURN VARCHAR IS
 
     encryption_mode NUMBER := DBMS_CRYPTO.ENCRYPT_AES128 + DBMS_CRYPTO.CHAIN_CBC  + DBMS_CRYPTO.PAD_PKCS5;
 
     BEGIN
          RETURN UTL_RAW.CAST_TO_VARCHAR2(DBMS_CRYPTO.DECRYPT
            (data, encryption_mode, UTL_I18N.STRING_TO_RAW(key, 'AL32UTF8')));
     END;
     /
 

Author:
rbygrave

Constructor Summary
Oracle10DbEncrypt()
          Constructs the Oracle10DbEncrypt.
 
Method Summary
 
Methods inherited from class com.avaje.ebean.config.dbplatform.AbstractDbEncrypt
getDbEncryptFunction, getEncryptDbType, isBindEncryptDataFirst
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Oracle10DbEncrypt

public Oracle10DbEncrypt()
Constructs the Oracle10DbEncrypt.



Copyright © 2010. All Rights Reserved.