How to create a new instance of the default encryption plug-in
1  
1  
$ACTUATE_HOME/BRDPro/eclipse/plugins/com.actuate.birt.model.defaultsecurity_11.0.1
2  
$ACTUATE_HOME/BRDPro/eclipse/plugins
3  
$ACTUATE_HOME/BRDPro/eclipse/plugins/Copy of com.actuate.birt.model.defaultsecurity_11.0.1
to a new name, such as:
$ACTUATE_HOME/BRDPro/eclipse/plugins/com.actuate.birt.model.defaultsecurity_11.0.1_rsa
2  
1  
$ACTUATE_HOME/BRDPro/eclipse/plugins/com.actuate.birt.model.defaultsecurity_11.0.1_rsa/META-INF/MANIFEST.MF
2  
Bundle-SymbolicName:com.actuate.birt.model.defaultsecurity
to:
Bundle-SymbolicName:com.actuate.birt.model.defaultsecurity.rsa
MANIFEST.MF now looks similar to the one in Listing 2-4.
Listing 2-4  
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Actuate Default Security Plug-in
Bundle-SymbolicName: com.actuate.birt.model.defaultsecurity.rsa;singleton:=true
Bundle-Version: 11.0.1.<version>
Require-Bundle: org.eclipse.birt.report.model,
org.eclipse.core.runtime
Export-Package: com.actuate.birt.model.defaultsecurity.api
Bundle-ClassPath: acdefaultsecurity.jar
Bundle-Vendor: Actuate Corporation
Eclipse-LazyStart: true
Bundle-Activator: com.actuate.birt.model.defaultsecurity.properties.SecurityPlugin
3  
3  
1  
$ACTUATE_HOME/BRDPro/eclipse/plugins/com.actuate.birt.model.defaultsecurity_11.0.1_rsa/plugin.xml
2  
extensionName="jce"
to:
extensionName="rsa"
plugin.xml now looks similar to the one in Listing 2-5.
Listing 2-5  
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension id="encryption"
  name="default encryption helper"
  point="org.eclipse.birt.report.model.encryptionHelper">
  <encryptionHelper class="com.actuate.birt.model.defaultsecurity.api.DefaultEncryptionHelper"
    extensionName="rsa" isDefault="true" />
  </extension>
</plugin>
3  
4  
1  
$ACTUATE_HOME/BRDPro/eclipse/plugins/com.actuate.birt.model.defaultsecurity_11.0.1/plugin.xml
2  
isDefault="true"
to:
isDefault="false"
3  
5  
1  
$ACTUATE_HOME/BRDPro/eclipse/plugins/com.actuate.birt.model.defaultsecurity_11.0.1_rsa/encryption.properties
2  
type=public encryption
3  
algorithm=RSA
4  
Copy the pre-generated private and public keys for RSA to the symmetric-key and public-key properties. encryption.properties now looks similar to the one in Listing 2-6.
Listing 2-6  
#message symmetric encryption , public encryption
  type=public encryption
#private encryption: DES(default), DESede
#public encryption: RSA
  algorithm=RSA
# NONE , CBC , CFB , ECB( default ) , OFB , PCBC
  mode=ECB
#NoPadding , OAEP , PKCS5Padding( default ) , SSL3Padding
padding=PKCS5Padding
#For key , support default key value for algorithm
#For DESede ,DES we only need to support private key
#private key value of DESede algorithm : 20b0020e918..
#private key value of DES algorithm: 527c23ea...
#for RSA algorithm , there is key pair. you should support
#private-public key pair
#private key value of RSA algorithm: 308202760201003....
#public key value of RSA algorithm: 30819f300d0....
#private key
symmetric-key=308202760....
#public key
public-key=30819f300d0.....
5  
6  
To test the new default RSA encryption, open a BIRT Report Designer and create a new report design. Create a data source and type the password.
7  
View the XML source of the report design file. Locate the data source definition code. The encryptionID is rsa, as shown in Listing 2-7.
Listing 2-7  
<data-sources>
  <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="6">
    <text-property name="displayName"></text-property>
    <property name="odaDriverClass">
      com.mysql.jdbc.Driver
    </property>
    <property name="odaURL">
      jdbc:mysql://192.168.218.225:3306/classicmodels
    </property>
    <property name="odaUser">root</property>
    <encrypted-property name="odaPassword" encryptionID="rsa">
      36582dc88.....
    </encrypted-property>
  </oda-data-source>
</data-sources>
8  
Create a data set and a simple report design. Preview the report to validate that BIRT connects successfully to the database server using the encrypted password. Before trying to connect to the data source the report engine decrypts the password stored in the report design using the default RSA encryption. The engine sends the decrypted value to the database server.

Additional Links:

Copyright Actuate Corporation 2012