Skip to content

Instantly share code, notes, and snippets.

View adadurov's full-sized avatar
🎯
Focusing

Alexey Adadurov adadurov

🎯
Focusing
View GitHub Profile
@adadurov
adadurov / Program.cs
Last active December 3, 2023 11:35
X509Certificate2 with private key in TPM2
// depends on https://github.com/adadurov/OpenSsl.DynamicEngine
//
// which is a fork of https://github.com/Dvergatal/OpenSsl.DynamicEngine with a minor fix
using System.Net;
using System.Security.Authentication;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
var tpm2Pkcs11LibraryPath = "/usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1.9.0";