Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-18 Thread Jonathan Pryor
On Feb 18, 2013, at 10:17 AM, Nikola wrote: > I've sent you all necessary details to reproduce the NullReference exception. Thank you. I'll investigate this tomorrow. >> I'm told by the resident SSL expert ... and this RSA instance will be used >> in the SSL handshake logic. ... > The last lin

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-18 Thread Nikola
I've sent you all necessary details to reproduce the NullReference exception. > I'm told by the resident SSL expert ... and this RSA instance will be used > in the SSL handshake logic. I've tried to inherit from System.Security.Cryptography.RSA and use the IPrivateKey in this custom class to do

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-14 Thread Jonathan Pryor
On Feb 14, 2013, at 4:45 PM, Nikola wrote: > I think what is needed here is an ability to somehow override the default > implementation of SSL handshake to be able to sign those random bytes in a > custom way I'm told by the resident SSL expert (not me!) that HttpWebRequest.ClientCertificates

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-14 Thread Jonathan Pryor
On Feb 14, 2013, at 4:00 PM, Jonathan Pryor wrote: > I'll provide that code in a bit; if that doesn't help you, let's see about > getting a full repro... Bwa-ha-ha-ha-ha-ah-ha *cough* *splutter* Firstly, the links I previously provided have been invalidated due to refactoring (yay). That'll te

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-14 Thread Nikola
> This is very helpful context. Thank you. :-) You are welcome :) Glad that it helped to bring my point across, with English being my second language I sometimes wonder if my mails are clear enough. > Obvious question: Why do you need to use the KeyChain API? Why not just > include your client c

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-14 Thread Jonathan Pryor
On Feb 14, 2013, at 3:20 PM, Nikola wrote: > This is not what I want to achieve. What am I trying to do here is, I > believe, "officially" called Mutual SSL authentication. ... > I am pretty sure you are already familiar with how the SSL handshake works > :), I just want to be absolutely positiv

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-14 Thread Nikola
Jon, > Using the .NET networking stack and using the > ServicePointManager.ServerCertificateValidationCallback callback allows me > to connect to a site which uses a self-signed certificate This is not what I want to achieve. What am I trying to do here is, I believe, "officially" called Mutual S

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-14 Thread Jonathan Pryor
On Feb 8, 2013, at 7:41 AM, Nikola wrote: > I've tried to use HttpsUrlConnection > (http://androidapi.xamarin.com/?link=T%3aJavax.Net.Ssl.HttpsURLConnection) > instead, but unfortunately, I am getting very similar results. Unfortunately, I cannot use your code as-is, as it's missing crucial con

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-08 Thread Nikola
:) I got the same impression from the second URL. From what you say I gather the P/Invoke is basically a no-go, so I think I will have to say goodbye to HttpWebRequest. I've tried to use HttpsUrlConnection (http://androidapi.xamarin.com/?link=T%3aJavax.Net.Ssl.HttpsURLConnection) instead, but unfo

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-07 Thread Jonathan Pryor
On Feb 7, 2013, at 12:40 PM, Nikola wrote: > thank you for you answer. I would be grateful if you could elaborate a bit, > because I am not sure how would using DllImport help me with this. The first url [0] referenced an answer [1] which referenced using `libkeystore.so`, which has a C functio

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-07 Thread Nikola
Hi, thank you for you answer. I would be grateful if you could elaborate a bit, because I am not sure how would using DllImport help me with this. To rephrase - so far, I've been "translating" the /Java.Security.IPrivateKey/ instance to /System.Security.Cryptography.RSA/ instance by converting th

Re: [mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-07 Thread Atsushi Eno
Hello, This seems to be common to Java and Android 4.1 issue. I found these StackOverflow. Maybe you can use some technique described there (either by using [DllImport], or create jar for them and use binding library). http://stackoverflow.com/questions/11261774/using-android-4-1-keychain htt

[mono-android] KeyChain API on Android 4.1 and client certificate authentication

2013-02-06 Thread Nikola
Hi, I need to issue HTTP requests against a server that requires authentication with client certificates. So far (on Android 4.0), I've been using KeyChain API to get the certificate and the associated private key: X509Certificate[] certificateChain = KeyChain.GetCertificateChain(this, a