From a79c3af3c7a754ff7971f916e2eefbb77ab9e243 Mon Sep 17 00:00:00 2001 From: Laurent Ellerbach Date: Thu, 17 Jun 2021 17:14:21 +0200 Subject: [PATCH] Adding X509Certificate2 Public and Private Key buffer access --- .../X509Certificates/X509Certificate2.cs | 12 ++++++++++++ version.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/nanoFramework.System.Net/X509Certificates/X509Certificate2.cs b/nanoFramework.System.Net/X509Certificates/X509Certificate2.cs index 1ef0ab2..09340a6 100644 --- a/nanoFramework.System.Net/X509Certificates/X509Certificate2.cs +++ b/nanoFramework.System.Net/X509Certificates/X509Certificate2.cs @@ -155,6 +155,18 @@ public bool HasPrivateKey } } + /// + /// Gets the private key, null if no private key + /// + /// This will give you access directly to the raw decoded byte array of the private key + public byte[] PrivateKey => _privateKey; + + /// + /// Gets the public key + /// + /// This will give you access directly to the raw decoded byte array of the public key + public byte[] PublicKey => RawData; + /// /// Gets the date in local time after which a certificate is no longer valid. /// diff --git a/version.json b/version.json index f8da1f0..ee3aa31 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.6.5-preview.{height}", + "version": "1.7.0-preview.{height}", "assemblyVersion": { "precision": "revision" },