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 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ codeunit 1475 "RSA"
RSAImpl.InitializeRSA(KeySize);
end;

/// <summary>
/// Creates a RSA object with private key and returns the XML string.
/// </summary>
/// <param name="PrivateKey">private key as text</param>
/// <param name="IncludePrivateParameters">true to include a public and private RSA key; false to include only the public key.</param>
/// <returns>An XML string containing the key of the current RSA object.</returns>
procedure ToSecretXmlString(PrivateKey: SecretText; IncludePrivateParameters: Boolean): SecretText
begin
exit(RSAImpl.ToSecretXmlString(PrivateKey, IncludePrivateParameters));
end;

/// <summary>
/// Creates and returns an XML string containing the key of the current RSA object.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@
DotNetRSA.FromXmlString(XmlString);
end;
#endif

procedure ToSecretXmlString(PrivateKey: SecretText; IncludePrivateParameters: Boolean): SecretText
begin
DotNetRSA := DotNetRSA.Create(2048);
DotNetRSA.ImportFromPem(PrivateKey);

Check failure on line 193 in src/System Application/App/Cryptography Management/src/RSAImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Default) / System Application and Tools (Default)

AL0133 Argument 1: cannot convert from 'SecretText' to 'DotNet "System.ReadOnlySpan<System.Char>"'

Check failure on line 193 in src/System Application/App/Cryptography Management/src/RSAImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Translated) / System Application and Tools (Translated)

AL0133 Argument 1: cannot convert from 'SecretText' to 'DotNet "System.ReadOnlySpan<System.Char>"'

Check failure on line 193 in src/System Application/App/Cryptography Management/src/RSAImpl.Codeunit.al

View workflow job for this annotation

GitHub Actions / Build System Application and Tools (Clean) / System Application and Tools (Clean)

AL0133 Argument 1: cannot convert from 'SecretText' to 'DotNet "System.ReadOnlySpan<System.Char>"'
exit(ToSecretXmlString(IncludePrivateParameters));
end;

procedure ToSecretXmlString(IncludePrivateParameters: Boolean): SecretText
begin
exit(DotNetRSA.ToXmlString(IncludePrivateParameters));
Expand Down
Loading