03-17-2023 09:26 AM - last edited on 07-31-2023 08:28 AM by JackLacava
I am implementing a BR that pulls a file from FTP. The file is encrypted so I need to decrypt it using a third party library. In order to decrypt it, I need to pass in a physical path to the PGP key provided. I uploaded the key to the Public folder share for now but cannot seem to find a way to get the actual physical file. Does anyone know if uploading a file to the share folder results in an actual file being created on the server or is it just stored as a BLOB in the database?
Solved! Go to Solution.
03-17-2023 09:50 AM
Actually I got it. I was uploading the file to the application DB folder vs. the File Share folder. I was able to get everything to work.
03-17-2023 09:50 AM
Actually I got it. I was uploading the file to the application DB folder vs. the File Share folder. I was able to get everything to work.
04-18-2023 07:06 AM
Hi HRunyon - Can you share sample BR rules for PGP decryption/encryption? We have a similar requirement for this.
Thanks
04-18-2023 09:45 AM
Hi KKGamer,
OneStream does not include the ability to do the PGP decryption/encryption out of the box, that I know of anyway. We have a third party component called DidiSoft that we use for other apps. We simply leveraged this same component by sending the DLL's to OneStream support and asking that they place them in the integrations folder. DidiSoft requires a license but if you purchase it then I'm happy to send the BR rule that will do the decryption. Their component is very easy to use so my guess is that you would not need a sample, it's literally a few lines of code to do the work. Happy to provide nonetheless.
Thanks
04-18-2023 09:52 AM
Hi HRunyon,
OneStream support recommended us to using DidiSoft for the process, so if you can share more details for the process and provide the BR rules.It will be helpful.
Thanks
04-18-2023 11:01 AM
Hi KKGamer,
Not sure why but I'm unable to reply to this thread. Send an email to hrunyon@compintelligence.com and I'll send you what you need.
Thanks,
Monday
Hey HRunyon,
Can you please the BR used to me as well?
yesterday
Unfortunately, I cannot send you the BR but can provide some sample code for you. Please note that the following two DLL files (provided by purchasing the DidiSoft software) need to be placed into the client integration folder:
This can be done by submitting a ticket to OneStream. Once completed, then your BR must reference the DidiSOFT.pgp.dll file.
You will also need the path to the PGP key as well as the PGP key password if applicable.
Place this code in the top of your BR:
Imports DidiSoft.Pgp
Imports DidiSoft.Pgp.Exceptions
Function for decrypting:
Public Function DecryptFile(encryptedFilename As String,si As SessionInfo) As String
Dim pgpKey As String = $\\XXX.file.core.windows.net\onestreamshareprd1\FileShare\Applications\OneStreamDevelopment\Contents\XXXDecryptionCertificate_priv.asc
Dim pgpKeyPassword as String = "PASSWORD"
Dim newName As String = encryptedFilename.Replace(".pgp", "")
Dim clsPGP As PGPLib = New PGPLib()
clsPGP.DecryptFile(encryptedFilename,pgpKey,pgpKeyPassword ,newName)
'Now remove the initial PGP file
System.IO.File.Delete(encryptedFilename)
Return newName
End Function
Hope this helps, and good luck.
04-18-2023 11:07 AM
Hi HRunyon - I have got the information in the private message, thanks very much.
04-18-2023 11:24 AM
My pleasure