Posts

Showing posts with the label client-certificates

client certificate with NSUrlSessionDelegate in xamarin

client certificate with NSUrlSessionDelegate in xamarin I want to implement client certificate authentication in my xamarin app. On top of that I am using a custom Certificate Authority (CA) and TLS 1.2. Until now I managed to get it running using android, UWP and WPF. The only platform missing is ios. Here is my NSUrlSessionDelegate: public class SSLSessionDelegate : NSUrlSessionDelegate, INSUrlSessionDelegate { private NSUrlCredential Credential { get; set; } private SecIdentity identity = null; private X509Certificate2 ClientCertificate = null; private readonly SecCertificate CACertificate = null; public SSLSessionDelegate(byte caCert) : base() { if (caCert != null) { CACertificate = new SecCertificate(new X509Certificate2(caCert)); } } public void SetClientCertificate(byte pkcs12, char password) { if (pkcs12 != null) { ClientCertificate = new X509Certificate2(pkcs12, new string(passw...