Converting Base64 string to binary in Blue Prism

I was working on a use case to store binary file (PKCS 12 certificate) in Blue Prism Security-Credentials. Unfortunately Security-Credentials do not support storing binary files. So I thought of converting binary to file to Base64 string and storing it in Security-Credentials as password and decoding it back to binary in Blue Prism process. Although encoded Base64 string had 4000 characters it was successfully stored in Security-Credentials. It turns out that in standard built-in Blue Prism objects there is no which can decode Base64 string to binary.
But it is very easy to create such object. It is just a matter of creating object with single code block with single code line.

Decode Base64 string to bytes
bytes = System.Convert.FromBase64String(base64String)

It is also very easy to encode bytes to Base64 string.

base64String = System.Convert.ToBase64String(bytes)

I created XML export of this object using 6.5.1 Blue Prism which you may find my Github repository. Additionally I created process which tests whether encoding and decoding works as expected.

I also committed export of this process to Github.

Leave a Comment