Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,

I'm a newbee in IOS development. So probably my question is like a bit St**id.

I installed a certificate to access protected web content on my iphone. It works perfectly with safari.
Now I'm developping an intern app that will display this protected content in a webview.

Actually, I have this certificate as a ressource in my app. But I would like to use the one working with safari and already installed on the phone.

How can I do that? What is the way? Do you have an example?

See below, I would like to get the newCredential from iphone and not like now by reading the certificate file.

Thanks a lot!

NSLog(@"Autentification: Trying Certificat");

    SecIdentityRef identity = [self readPfxClientCertificate]; // Go get a SecIdentityRef

    NSURLCredential *newCredential = [NSURLCredential credentialWithIdentity :identity

                                                        certificates:nil persistence:NSURLCredentialPersistenceNone];

    [[challenge sender] useCredential:newCredential forAuthenticationChallenge :challenge];
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900