Support for OpenSSH user certs such as ssh-rsa-cert-v01@openssh.com is currently experimental and can be performed like this:
using Rebex.Net;
using Rebex.Security.Cryptography;
...
// load proprietary OpenSSH certificate into SshPublicKey
var publicCert = new SshPublicKey("user01-opensshcert.pub");
// load OpenSSH certificate's private key into SshPrivateKey
var privateKey = new SshPrivateKey("user01.pri", password);
// associate the certificate with the private key
CryptoHelper.SetOption(privateKey, "OpenSshCert", publicCert);
// connect to a server using the key with associated cert
var sftp = new Sftp();
// enable experimental OpenSSH certificate support
CryptoHelper.SetOption(sftp.Settings.SshParameters, "EnableOpenSshCerts", true);
// register server key check handler
sftp.FingerprintCheck += MyServerKeyCheck;
// connect to a server
sftp.Connect("server01");
// authenticate using OpenSSH user cert
sftp.Login("user01", privateKey);
...
Additional information, mostly for context:
Historically, Rebex SFTP has supported the standard X.509 certificates, as specified by IETF RFC 6187. These use types x509v3-rsa2048-sha256 for RSA certificates and ecdsa-sha2-* for ECDSA certificates, and uses the same certificates as HTTP and other common protocols.
But strangely, it looks like Microsoft instead chose to use the proprietary OpenSSH certificates for Entra ID. These are not compatible with standard X.509 certificates and not endorsed by IETF. Rebex recommends using standard X.509 certificates whenever possible.