How to Securely Store and Use Decryption Keys in Bold Reports
This article explains how to securely store a decryption key in Bold Reports using the Custom Attributes feature and use it within report expressions without exposing the key to end users. Using custom attributes allows you to centrally manage sensitive information and allow access them during report execution. This ensures the key is available only during report execution and remains hidden from end users.
Steps to Configure the Decryption Key
- Access the Sites Management Page and Select the Required Site
Navigate to the UMS Sites page:http://[your-domain]/ums/sites. From the Sites page, select the site where the decryption key is to be stored.
Replace the URL with your Bold Reports UMS URL if different.
-
Open the Attributes Tab
Within the selected site, navigate to the Attributes tab and clickAdd Attributebutton.
-
Create a Custom Attribute
Create a new custom attribute that will store the decryption key. Provide a suitable name (e.g.,DecryptionKey) and store your decryption key as its value.
Name: DecryptionKey
Value:your-encrypted-or-secret-key
-
Create a Report Parameter
In the report designer create a new report parameter to prevent users from viewing the decryption key. -
Set the Parameter’s Default Value
Configure the parameter’s default value using the custom attribute syntax :${{:AttributeName}}.
Replace AttributeName with the name of the custom attribute you created (e.g., ${{:DecryptionKey}}).
-
Hide Parameter
Enable the Hidden option to ensure the report parameter is not visible to report users.
-
Add Custom VB Code
Add your custom VB code to the report that performs the necessary decryption or processing logic. Example:
Public Function PrintTwice(ByVal InputValue As String) As String
Return InputValue & InputValue
End Function
- Call the custom Code
In your report expression, call your custom VB code and pass the parameter value. For example:
=Code.PrintTwice(Parameters!ReportParameter1.Value)
The parameter value will be passed at runtime without being exposed to end users.
- Preview
Conclusion
This method provides a secure and maintainable way to use decryption keys in Bold Reports, ensuring that end users cannot directly access sensitive information.