Need physical path to file

HRunyon
New Contributor III

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?

HRunyon_0-1679059507898.png

 

1 ACCEPTED SOLUTION

HRunyon
New Contributor III

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.

View solution in original post

9 REPLIES 9

HRunyon
New Contributor III

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.

KKGamer
New Contributor III

Hi HRunyon - Can you share sample BR rules for PGP decryption/encryption? We have a similar requirement for this.

Thanks

 

 

HRunyon
New Contributor III

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

KKGamer
New Contributor III

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

HRunyon
New Contributor III

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,

Bansal_P
New Contributor II

Hey HRunyon, 

Can you please the BR used to me as well?

HRunyon
New Contributor III

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:

  • DidiSoft.BouncyCastle.dll
  • DidiSoft.Pgp.dll

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.

KKGamer
New Contributor III

Hi HRunyon - I have got the information in the private message, thanks very much. 

HRunyon
New Contributor III

My pleasure