---
title: "Codeunit 1286 X509Certificate2"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/1286-x509certificate2/
type: codeunit
id: 1286
name: "X509Certificate2"
app: "System Application"
namespace: System.Security.Encryption
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/1286-x509certificate2/source/24/ https://jonas-paprotka.de/ref/codeunit/1286-x509certificate2/source/25/ https://jonas-paprotka.de/ref/codeunit/1286-x509certificate2/source/26/ https://jonas-paprotka.de/ref/codeunit/1286-x509certificate2/source/27/ https://jonas-paprotka.de/ref/codeunit/1286-x509certificate2/source/28/ https://jonas-paprotka.de/ref/codeunit/1286-x509certificate2/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 1286 X509Certificate2

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/1286-x509certificate2/

| | |
| --- | --- |
| App | System Application |
| Namespace | System.Security.Encryption |
| Versions | 17-28 |
| Source file | Cryptography Management/src/X509Certificate2.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| VerifyCertificate | (var Text, Text, Enum X509 Content Type) | Boolean | public | 17-26 | Pending 24.0 | Use VerifyCertificate with SecretText data type for Password. |
| GetCertificateFriendlyName | (Text, Text, var Text) | - | public | 17-26 | Pending 24.0 | Use GetCertificateFriendlyName with SecretText data type for Password. |
| GetCertificateSubject | (Text, Text, var Text) | - | public | 17-26 | Pending 24.0 | Use GetCertificateSubject with SecretText data type for Password. |
| GetCertificateThumbprint | (Text, Text, var Text) | - | public | 17-26 | Pending 24.0 | Use GetCertificateThumbprint with SecretText data type for Password. |
| GetCertificateIssuer | (Text, Text, var Text) | - | public | 17-26 | Pending 24.0 | Use GetCertificateIssuer with SecretText data type for Password. |
| GetCertificateExpiration | (Text, Text, var DateTime) | - | public | 17-26 | Pending 24.0 | Use GetCertificateExpiration with SecretText data type for Password. |
| GetCertificateNotBefore | (Text, Text, var DateTime) | - | public | 17-26 | Pending 24.0 | Use GetCertificateNotBefore with SecretText data type for Password. |
| HasPrivateKey | (Text, Text) | Boolean | public | 17-26 | Pending 24.0 | Use HasPrivateKey with SecretText data type for Password. |
| GetCertificatePropertiesAsJson | (Text, Text, var Text) | - | public | 17-26 | Pending 24.0 | Use GetCertificatePropertiesAsJson with SecretText data type for Password. |
| GetCertificatePublicKey | (Text, Text) | Text | public | 19-26 | Pending 24.0 | Use GetCertificatePublicKey with SecretText data type for Password. |
| GetCertificatePrivateKey | (Text, Text) | Text | public | 19-26 | Pending 24.0 | Use GetCertificatePrivateKey with SecretText data type for Password and return value. |
| GetCertificateSerialNumber | (Text, Text, var Text) | - | public | 22-26 | Pending 24.0 | Use GetCertificateSerialNumber with SecretText data type for Password. |
| GetCertificateSerialNumberAsASCII | (Text, Text, var Text) | - | public | 22-26 | Pending 24.0 | Use GetCertificateSerialNumberAsASCII with SecretText data type for Password. |
| VerifyCertificate | (var Text, SecretText, Enum X509 Content Type) | Boolean | public | 24-28 | - | - |
| GetCertificateFriendlyName | (Text, SecretText, var Text) | - | public | 24-28 | - | - |
| GetCertificateSubject | (Text, SecretText, var Text) | - | public | 24-28 | - | - |
| GetCertificateThumbprint | (Text, SecretText, var Text) | - | public | 24-28 | - | - |
| GetCertificateIssuer | (Text, SecretText, var Text) | - | public | 24-28 | - | - |
| GetCertificateExpiration | (Text, SecretText, var DateTime) | - | public | 24-28 | - | - |
| GetCertificateNotBefore | (Text, SecretText, var DateTime) | - | public | 24-28 | - | - |
| HasPrivateKey | (Text, SecretText) | Boolean | public | 24-28 | - | - |
| GetCertificatePropertiesAsJson | (Text, SecretText, var Text) | - | public | 24-28 | - | - |
| GetCertificatePublicKey | (Text, SecretText) | Text | public | 24-28 | - | - |
| GetCertificatePrivateKey | (Text, SecretText) | SecretText | public | 24-28 | - | - |
| GetCertificateSerialNumber | (Text, SecretText, var Text) | - | public | 24-28 | - | - |
| GetCertificateSerialNumberAsASCII | (Text, SecretText, var Text) | - | public | 24-28 | - | - |
| CreateFromPemAndExportAsBase64 | (Text, SecretText, SecretText) | Text | public | 27-28 | - | - |
| GetCertificatePublicKeyAsBase64String | (Text, SecretText) | Text | public | 28 | - | - |
| GetRawCertDataAsBase64String | (Text, SecretText) | Text | public | 28 | - | - |

## Source

Symbols: Microsoft.SystemApplication.symbols.63ca2fa4-4f03-4f2b-a480-172fef340d3f, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 24: https://github.com/microsoft/BCApps, MIT, releases/24.x at fe14d3e6db00d28df3a69c7bba830813d70794e2.
AL source 25: https://github.com/microsoft/BCApps, MIT, releases/25.x at 68d52c129129c83b2e396a473aaa5b2ce61d2eed.
AL source 26: https://github.com/microsoft/BCApps, MIT, releases/26.x at 78c4acf0d64a8eee157ea80164fa8fc2acffc9eb.
AL source 27: https://github.com/microsoft/BCApps, MIT, releases/27.x at 1749020b4c9445a43e4f7f540e89b7fa76ec25fd.
AL source 28: https://github.com/microsoft/BCApps, MIT, releases/28.x at 740f59156b249f8ed7cba2e28423f03ae7b07233.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
