Generating encryption keys
The default encryption plug‑in provides classes that can be used to generate different encryption keys. The classes names are SymmetricKeyGenerator and PublicKeyPairGenerator. SymmetricKeyGenerator generates private keys, which are also known as symmetric keys. PublicKeyPairGenerator generates public keys. Both classes require acdefaultsecurity.jar in the classpath.
Both classes take two parameters, the encryption algorithm and the output file, where the generated encrypted key is written. The encryption algorithm is a required parameter. The output file is an optional parameter. If you do not provide the second parameter, the output file is named key.properties and is saved in the current folder. The encryption algorithm values are shown in Table 47‑4.
Table 47‑4 Key-generation classes and parameters
Class name
Encryption algorithm parameter
com.actuate.birt.model.defaultsecurity.api.keygenerator.SymmetricKeyGenerator
des
com.actuate.birt.model.defaultsecurity.api.keygenerator.SymmetricKeyGenerator
desede
com.actuate.birt.model.defaultsecurity.api.keygenerator.PublicKeyPairGenerator
rsa
How to generate a symmetric encryption key
Run the main function of SymmetricKeyGenerator.
1 To navigate to the default security folder, open a command prompt window and navigate to the default security plugin directory using a command similar to the following:
cd C:\Program Files\BRDPro\eclipse\plugins\com.actuate.birt.model.defaultsecurity_<Release>
2 To generate the key, as shown in Figure 47‑2, type:
java -cp acdefaultsecurity.jar com.actuate.birt.model.defaultsecurity.api.keygenerator.SymmetricKeyGenerator des
Figure 47‑2 Symmetric key generation
3 The generated key is saved in the file, key.properties. The content of the file looks like this one:
#Key Generator
#Fri Dec 20 12:03:03 PST 2013
symmetric-key=fbbf1f91028...
4 Copy the key from the generated key file to the encryption.properties file.
How to generate a public key using RSA encryption
Run the main function of PublicKeyPairGenerator.
1 To navigate to the default security folder, open a command prompt window and navigate to the default security plugin directory using a command similar to the following:
cd C:\Program Files\BRDPro\eclipse\plugins\com.actuate.birt.model.defaultsecurity_<Release>
2 In the command prompt window, type:
java -cp acdefaultsecurity.jar com.actuate.birt.model.defaultsecurity.api.keygenerator.PublicKeyPairGenerator rsa
The class generates a pair of keys saved in the key.properties file:
#Key Generator
#Fri Dec 20 12:05:18 PST 2013
public-key=30819f300d06092a86...
symmetric-key=3082027...
 
3 Copy the key from the generated key file to the encryption.properties file.