Read SSL Certificate Details on WP8

后端 未结 4 1357
旧巷少年郎
旧巷少年郎 2021-01-03 03:25

I want to read certificate details (e.g. expiration date or CN) for security reasons.

Usually there are some properties in network classes available, that allow to

4条回答
  •  既然无缘
    2021-01-03 03:52

    After trying open source libs like bouncyCastle, supersocket or webSocket4net I tested an evaluation of a commercial lib named ELDOS SecureBlackbox. This test was successfull. Here is a code snipped, that gets the X509Certificates with all details:

    public void OpenSSL()
    {
        var c = new TElSimpleSSLClient();
        c.OnCertificateValidate += new TSBCertificateValidateEvent(OnCertificateValidate);
    
        c.Address = "myhostname.com";
        c.Port = 443;
        c.Open();
        c.Close(false);
    }
    
    private void OnCertificateValidate(object sender, TElX509Certificate x509certificate, ref TSBBoolean validate)
    {
        validate = true;
    }
    

    The validation is getting all certificates... if validate is set to true, the next certificate will be shown. That means the callback is called forreach certificate there.

    Regards Holger

提交回复
热议问题