Hello, there are the Certificate.GetIssuerName and Certificate.GetIssuer() methods for the certificate issuer; and Certificate.GetSubjectName() and Certificate.GetSubject() methods for the certificate owner. Please see the following code for an example:
void ShowCertificateInfo(Certificate cert)
{
// issuer of the certificate
string issuerName = cert.GetIssuerName();
DistinguishedName dnIssuer = cert.GetIssuer(); // DistiguishedName enables you to inspect/parse individual fields
// owner of the certificate
string ownerName = cert.GetSubjectName();
DistinguishedName dnOwner = cert.GetSubject(); // DistiguishedName enables you to inspect/parse individual fields
Console.WriteLine("Certificate info:\n Issuer = '{0}' \n Owner = '{1}'.", issuerName, ownerName);
// -------
// to uniquely identify a certificate, there is the Subject Key Identifier (SKI). It is actually a hash of the certificate
byte[] ski = cert.GetSubjectKeyIdentifier();
}
void ftp_ValidatingCertificate(object sender, SslCertificateValidationEventArgs e)
{
// ...
ShowCertificateInfo(e.Certificate);
// ...
}
Ftp ftp = new Ftp();
ftp.ValidatingCertificate += ftp_ValidatingCertificate;
ftp.Connect("test.rebex.net", SslMode.Implicit);
ftp.Disconnect();