Thanks for your aid, i'm pleased to have response from you.
And you're right, i need to set up user accounts and think, there's good way to drag and drop key files into documents folder, which is the only option we can process with key files.
We can also consider the absolute path to key files from root (/) but we are not known where these key files are stored in iPhone file system. By this methods, we'll display list of flies through which user can select key files which we need to use to authenticate. Or we can use some naming conventions also so we come to know which files we need to use for particular account.
But we have tried with all these options giving absolute path as well as putting files into resource and copying into documents folder, but any of these are not working.
Don't know in which terms we lack anything, but we might have taken wrong way... possibly we are not doing what we need to do. Please let us know or give us any possible hint. Thanks for your solution. I'll post my answers if i get any solution.
Regards,
Paresh Thakor.
On Aug 10, 2010, at 9:30 PM, Ted Lemon wrote:
> On Aug 10, 2010, at 6:36 AM, Paresh Thakor wrote:
>> I'm implementing libssh2 for ssh implementation for my iPhone application. If anyone good to this, please let me know how can i put these files and where to put them? In documents directory for iPhone application? Or how can we access these files globally? I've tried few tricks but each of them failed. Please let me know how can i implement public/private key authorization.
>
> The easiest way to do this, just to try it out, is to put the files in the Resources folder in your xcode project. This will result in them being copied into the application bundle. You can then open them with this example code:
>
> privkey = [[NSBundle mainBundle] pathForResource: @"ipad" ofType: @"key"
> inDirectory: @""];
> pubkey = [[NSBundle mainBundle] pathForResource: @"ipad" ofType: @"pub"
> inDirectory: @""];
> rc = libssh2_userauth_publickey_fromfile(session,
> "mellon", [pubkey UTF8String],
> [privkey UTF8String], "");
>
> However, obviously this won't work for production use, since the user needs to set up their own key. For that, I think the right solution is to port the ssh-keygen functionality and generate the key on the iPad; any other solution is going to be impractical, because it will rely on some resource the user may or may not have (a machine that can run ssh-keygen), and on a secure path between the user's machine and the machine that generated the key, which is a bit of a chicken-and-egg problem. You could use iTunes file transfer for this, but I don't think it's at all secure.
>
> I'm working on an app for iPad that uses libssh2 as well, and so I'm running into similar problems--if I come up with a solution I'll let you know.
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-08-11