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

Update RSA.Codeunit.al #2255

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

Update RSA.Codeunit.al #2255

wants to merge 3 commits into from

Conversation

MattiLE
Copy link
Contributor

@MattiLE MattiLE commented Oct 24, 2024

Summary

Overload for ToSecretXmlString to work with a private key in a pem file.

Work Item(s)

Fixes #866

Fixes AB#555892
Fixes AB#524188

@MattiLE MattiLE requested a review from a team as a code owner October 24, 2024 13:37
@github-actions github-actions bot added AL: System Application From Fork Pull request is coming from a fork labels Oct 24, 2024
@JesperSchulz JesperSchulz added Linked Issue is linked to a Azure Boards work item Integration GitHub request for Integration area labels Oct 25, 2024
@github-actions github-actions bot added this to the Version 26.0 milestone Oct 25, 2024
Copy link
Contributor

@JesperSchulz JesperSchulz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't compile.
Also, should the private key not be a secret text, rather than text?

@JesperSchulz JesperSchulz self-assigned this Oct 25, 2024
@JesperSchulz
Copy link
Contributor

@MattiLE, compilation still fails: Error: AL0133 Argument 1: cannot convert from 'SecretText' to 'DotNet "System.ReadOnlySpan<System.Char>"'. Could you take another look? 😊

@MattiLE
Copy link
Contributor Author

MattiLE commented Dec 6, 2024

Hi @JesperSchulz, I sorry that you haven't heard from me for so long. Is there still a problem in the build process?

@JesperSchulz
Copy link
Contributor

Hi @JesperSchulz, I sorry that you haven't heard from me for so long. Is there still a problem in the build process?

No worries! I was trying to fix this myself, but doesn't seem like I succeeded! Let me take another look! As soon as this compiles, we can merge - right now it just doesn't 😟

@JesperSchulz
Copy link
Contributor

@MattiLE, if you can find time to make this compile, it'd be great, as I'm a bit behind on GitHub issues and PRs. There are MANY I need to look into 🥳

@MattiLE
Copy link
Contributor Author

MattiLE commented Dec 9, 2024

Hi @JesperSchulz, I am afraid that this will not work in the al context. In C# the conversion works implicitly. But it also works when I call up the explicit conversion.

ReadOnlySpan<Char> readonlyPrivateKey = MemoryExtensions.AsSpan(privateKey);

In al I get the runtime error ‘Specified method is not supported?’ with the same code.

ReadOnlySpan := MemoryExtensions.AsSpan(DotNetString);
assembly("System.Private.CoreLib")
    {
        type("System.ReadOnlySpan`1"; ReadOnlySpan) { }
        type("System.MemoryExtensions"; MemoryExtensions) { }
    }

I believe that the handling with the Generic does not work somehow.... I have not found a solution to this.

Perhaps one of you has an idea? Otherwise we have to close the PR and the conversion has to be done outside of BC :(

@JesperSchulz
Copy link
Contributor

Hi @JesperSchulz, I am afraid that this will not work in the al context. In C# the conversion works implicitly. But it also works when I call up the explicit conversion.

ReadOnlySpan<Char> readonlyPrivateKey = MemoryExtensions.AsSpan(privateKey);

In al I get the runtime error ‘Specified method is not supported?’ with the same code.

ReadOnlySpan := MemoryExtensions.AsSpan(DotNetString);
assembly("System.Private.CoreLib")
    {
        type("System.ReadOnlySpan`1"; ReadOnlySpan) { }
        type("System.MemoryExtensions"; MemoryExtensions) { }
    }

I believe that the handling with the Generic does not work somehow.... I have not found a solution to this.

Perhaps one of you has an idea? Otherwise we have to close the PR and the conversion has to be done outside of BC :(

Allow us to investigate! I'll get back to you (might take a short while though).

@JesperSchulz
Copy link
Contributor

@SBalslev, would you mind taking a look at this one?

@JesperSchulz
Copy link
Contributor

Just stumbled over this one, which ran into a similar issue: #309. Not sure how to get around this. DevTools (Steffen), you're up 😊

@JesperSchulz
Copy link
Contributor

I will discuss with @SBalslev in the coming weeks. There's a "right", but expensive solution, and there's a "workaround", which would come cheaper. We will hopefully soon be able to conclude.

@MattiLE
Copy link
Contributor Author

MattiLE commented Dec 10, 2024

I will discuss with @SBalslev in the coming weeks. There's a "right", but expensive solution, and there's a "workaround", which would come cheaper. We will hopefully soon be able to conclude.

Hey @JesperSchulz , thanks for your efforts

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 Integration GitHub request for Integration area Linked Issue is linked to a Azure Boards work item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BC Idea]: Extend BC System APP with RSASSA-PSS algorithm
2 participants