Skip to main content

Notifications

Business Central forum
Suggested answer

Codeunit 6227 "Signed XML Mgt."

Posted on by Microsoft Employee

We are trying to implement XmlDocument signing on Business Central.

If we understand the code correctly, we're supposed to import certificates into isolated storage, which we did.

And then we think we're supposed to use SignXmlText function from codeunit 6227.

[External] SignXmlText(XmlText : Text;PrivateKey : Text) : Text

However there does not seem to be any way to get access to the privatekey.

By looking at the code this is supposed to be hex encoded binary blob with the actual private key data.

Are there any samples / documentation where we could see how we're supposed to do this?

Docker image: bcinsider.azurecr.io/bcsandbox-master

Application version: 14.0.26992.0

Platform version: 14.0.26873.0

Categories:
  • CU23060257-1 Profile Picture
    CU23060257-1 2 on at
    Codeunit 6227 "Signed XML Mgt."
    I got (what I think is a key) using the code:
     
    [Ok := ]  IsolatedStorage.Get(Key: String, [DataScope: DataScope], var Value: Text)
     
    It looks like: (11kb long)
     
    MIIf3wIBAzCCH5gGCSqGSIb3DQEHAaCCH4kEgh+FMIIfgTCCBXUGCSqGSIb3DQEHAa....
    ...PU/B+DBBTUPQ0mM1HU9n2dZrHVLrRR6DP1lwIDAYag
     
    When I parse this to Cod6227 SignedXMLMgt.SignXmlText(), I got the error:
     
    A call to System.Security.Cryptography.RSACryptoServiceProvider.ImportCspBlob failed with this message: Bad Version of provider.
    The version I am using is BC14.
  • BojanL Profile Picture
    BojanL 12 on at
    RE: Codeunit 6227 "Signed XML Mgt."

    He probably thinks about table 1262 "Isolated Certificate" not "Isolated storage"?

    This can be done through UI.

    7823.2019_2D00_01_2D00_12-19_5F00_00_5F00_50_2D00_Uredi-_2D00_-Isolated-Certificate.png

    BR,

    Bojan

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,160 Most Valuable Professional on at
    RE: Codeunit 6227 "Signed XML Mgt."

    How is your code for importing the certificate key into the Isolated Storage?

    You can read a key saved in the Isolated Storage by using:

    [Ok := ]  IsolatedStorage.Get(Key: String, [DataScope: DataScope], var Value: Text)

    With this method, the key you read is associated to the Value text variable.

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,451 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,353 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans