Skip to content
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
2 changes: 1 addition & 1 deletion nanoFramework.System.Net/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

////////////////////////////////////////////////////////////////
// update this whenever the native assembly signature changes //
[assembly: AssemblyNativeVersion("100.2.0.11")]
[assembly: AssemblyNativeVersion("100.2.0.12")]
////////////////////////////////////////////////////////////////

// Setting ComVisible to false makes the types in this assembly not visible
Expand Down
22 changes: 22 additions & 0 deletions nanoFramework.System.Net/Security/CertificateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,27 @@ public static bool AddCaCertificateBundle(string ca)
/// </remarks>
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern bool AddCaCertificateBundle(byte[] ca);

/// <summary>
/// Loads the device public key from the device certificate store.
/// If public key was found, initializes a new instance of the <see cref="X509Certificate"/>.
/// </summary>
/// <returns>The certificate that was loaded from the certificate store.</returns>
/// <remarks>
/// This method is exclusive of nanoFramework. There is no equivalent in .NET framework.
/// </remarks>
public static X509Certificate GetDevicePublicKey()
{
byte[] certificate = GetDevicePublicKeyRaw();
if (certificate is not null)
{
return new X509Certificate(certificate);
}

return null;
}

[MethodImpl(MethodImplOptions.InternalCall)]
private static extern byte[] GetDevicePublicKeyRaw();
}
}
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.11",
"version": "1.12",
"assemblyVersion": {
"precision": "build"
},
Expand Down