web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Encrypt Vendor Payment File with PGP security

(0) ShareShare
ReportReport
Posted on by 4,624

Hey ,

I am generating Vendor payment file through electronic reporting. It is an xml file , i want it to be encrypted with PGP Encryption. Can you please suggest how do that using in X++ ? 

I have the same question (0)
  • Martin Dráb Profile Picture
    235,961 Most Valuable Professional on at
    RE: Encrypt Vendor Payment File with PGP security

    What do you mean by "how should be the Public key"?

  • Rohin Profile Picture
    4,624 on at
    RE: Encrypt Vendor Payment File with PGP security

    Martin , I used BouncyCastle and created on C# project library:-

    pastedimage1599807873616v1.png    pastedimage1599808770557v2.png

    Then I add this as a referenced to FO project and called this Dll method, 

    pastedimage1599809479368v3.png

    I suspecting about these 3 parameters ( highlighted yellow)  , Can you please guide me how should be the Public key that i should try for testing? 

  • Martin Dráb Profile Picture
    235,961 Most Valuable Professional on at
    RE: Encrypt Vendor Payment File with PGP security

    No, it's not. Do you see any PGP keys used in the example? If not, how could it be about PGP? BouncyCastle supports many different encryption algorithms, not just PGP, therefore you can't assume that everything you find about BouncyCastle is related to PGP. Look at PgP Encryption and Decryption using BouncyCastle c# instead.

    Also note that this was just an example. There are likely more libraries that you could use.

  • Rohin Profile Picture
    4,624 on at
    RE: Encrypt Vendor Payment File with PGP security

    Thanks Martin and Nuno .

    I found this link that using Bouncy Castle . Can you please suggest is this example of PGP encryption??

  • nunomaia Profile Picture
    23 Moderator on at
    RE: Encrypt Vendor Payment File with PGP security

    I never used BouncyCastle, but Martin suggestion might be a better solution for you.

    Azure function it is an HTTP endpoint that is executed from F&O.

    docs.microsoft.com/.../functions-create-your-first-function-visual-studio

  • Martin Dráb Profile Picture
    235,961 Most Valuable Professional on at
    RE: Encrypt Vendor Payment File with PGP security

    Also note that there are .NET Framework libraries you could use, such as BouncyCastle.

  • Rohin Profile Picture
    4,624 on at
    RE: Encrypt Vendor Payment File with PGP security

    Thanks Nuno , I wanna understand more about point 2 . How to execute Azure function for PGP Encryption using X++ ?  Would you please redirect me to some examples you wanna share?

  • Suggested answer
    nunomaia Profile Picture
    23 Moderator on at
    RE: Encrypt Vendor Payment File with PGP security

    Azure functions runs outside D365 F&O, it’s a simple way to run processes, etc.  that cannot be executed inside F&O. For example I already used Azure functions with F&O to export payment files to Bank’s SFTP, encrypt data with PGP, etc.

    Not all is possible to perform inside F&O.

    What you can do ( just an example ), there are other possibilities  

    1 - Export payment files from Electronic Reporting to Azure Blob storage.

    2 - After exporting, inside F&O, execute an Azure Function to encrypt data ( read from Blob Storage and write back to Azure Storage ).

    3 - Read Result from F&O

  • Rohin Profile Picture
    4,624 on at
    RE: Encrypt Vendor Payment File with PGP security

    Martin , I have to Encrypt payment file while its getting generated from D365FO.

    Moreover , Encryption using Azure functions is something outside from D365FO ? I would like to know about this as well , please elaborate more

  • Martin Dráb Profile Picture
    235,961 Most Valuable Professional on at
    RE: Encrypt Vendor Payment File with PGP security

    PgpCore is for .NET Core and it can't be loaded to .NET Framework applications such as D365FO. I suspect it's what you're trying to do.

    Nuno suggested something else - using it in Azure Functions.

    Visual Studio 2015 doesn't support .NET Core development, therefore use a newer version for this purpose.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 789 User Group Leader

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 607 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 497 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans