Creating a BIRT report that uses the default encryption
This section describes an example that shows how the entire mechanism works. This example uses BIRT Designer Professional to create a report design. The report design connects to a MySQL Enterprise database server using the user, root, and password, root, as shown in Figure 47‑1.
Figure 47‑1 Data source properties for the encryption example
The encryption model stores the encrypted value of the database password in the report design file. Along with the value, the model stores the encryptionID. In this way, it identifies the encryption mechanism used to encrypt the password, as shown in the <encrypted-property> element in the following code:
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="6">
<property name="odaDriverClass">
com.mysql.jdbc.Driver
</property>
<property name="odaURL">
jdbc:mysql://127.0.0.1:3306/classicmodels
</property>
<property name="odaUser">root</property>
<encrypted-property name="odaPassword" encryptionID="jce">
10e52…
</encrypted-property>
</oda-data-source>
</data-sources>
BIRT iHub uses the encryptionID attribute of the <encrypted-property> element to identify the algorithm to decrypt the password. After using the algorithm on the value of <encrypted-property>, BIRT iHub connects to the database and generates the report.