Codeunit 1474 Signature Key, source in 28

Source242526272829metadata in 28

src/System Application/App/Cryptography Management/src/SignatureKey.Codeunit.al49 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.Security.Encryption;

/// <summary>
/// Represents the key of asymmetric algorithm.
/// </summary>
codeunit 1474 "Signature Key"
{
    Access = Public;
    InherentEntitlements = X;
    InherentPermissions = X;

    var
        SignatureKeyImpl: Codeunit "Signature Key Impl.";


    /// <summary>
    /// Saves an key value from the key information from an XML string.
    /// </summary>
    /// <param name="XmlString">The XML string containing key information.</param>
    procedure FromXmlString(XmlString: SecretText)
    begin
        SignatureKeyImpl.FromXmlString(XmlString);
    end;

    /// <summary>
    /// Saves an key value from an certificate in Base64 format
    /// </summary>
    /// <param name="CertBase64Value">Represents the certificate value encoded using the Base64 algorithm</param>
    /// <param name="Represents the password of the certificate">Certificate Password</param>
    /// <param name="IncludePrivateParameters">true to include private parameters; otherwise, false.</param>
    procedure FromBase64String(CertBase64Value: Text; Password: SecretText; IncludePrivateParameters: Boolean)
    begin
        SignatureKeyImpl.FromBase64String(CertBase64Value, Password, IncludePrivateParameters);
    end;

    /// <summary>
    /// Gets an XML string containing the key of the saved key value.
    /// </summary>
    /// <returns>An XML string containing the key of the saved key value.</returns>
    procedure ToXmlString(): SecretText
    begin
        exit(SignatureKeyImpl.ToXmlString());
    end;
}