Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to the Crypto Module to create P12 certs containing… #2870

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

StefanMaron
Copy link
Contributor

@StefanMaron StefanMaron commented Jan 31, 2025

Summary

  • Added a new dotnet wrapper to expose X509Certificate2.CreateFromPem
  • Added new functions on X509Certificate2 and on RSA Codeunits

I did not yet create any tests for this, since I am not sure how I can test this and whether it needs testing since its essentially just wrapping dotnet functions.

I am not sure how you want to handle the custom dotnet library. I have included the code I created for testing here. If you want to to move/change anything, just let me know

Work Item(s)

Fixes #2516

@StefanMaron StefanMaron requested review from a team as code owners January 31, 2025 14:13
@github-actions github-actions bot added AL: System Application From Fork Pull request is coming from a fork labels Jan 31, 2025
@ajkauffmann
Copy link
Contributor

After a lengthy discussion with @StefanMaron about the scenario, I've fiddled around with DotNet objects to find a way to achieve this without a custom .Net assembly. And I found a way that works.

Part of it uses the X509Certificate2(Byte[], string) constructor, which is known as dangerous because it allegedly creates temporary files and doesn't clean up afterward. Used incorrectly, it could potentially lead to disk overload. Therefore, I would recommend using this as a temporary solution and still plan for support of Span<T> and ReadOnlySpan<T> in AL code.

I'll discuss with @StefanMaron the code next week so he can change the PR accordingly (if he agrees with what I found).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AL: System Application From Fork Pull request is coming from a fork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Can not generate a .p12 Certificate in AL
2 participants