It seems i'm having some trouble understanding NSTask in Cocoa. The application that I want to launch is openSSL. Currently, I'm able to send the information (launch path, arguments etc.) and I can get a response as well using NSPipe. What I need to be able to do though is to respond to the input requests that the application asks for. With the following code, I can send and read a response from a file:
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: launchPath];
[task setArguments: arguments];
[task setCurrentDirectoryPath:dir];
NSPipe *pipe;
pipe = [NSPipe pipe];
[task setStandardOutput: pipe];
NSFileHandle *file;
file = [pipe fileHandleForReading];
[task launch];
NSData *data;
data = [file readDataToEndOfFile];
NSString *response = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding];
Once I launch the NSTask, I'm expected to provide things like the Domain Name, Country etc. The reason for my question is because I need to be able to generate a Certificate Signing Request with openSSL and send it, along with some other data, over to a server. The code above is not broken, I'm just not sure how I can go about sending over that input.
Also, if anyone has used some sort of openSSL implementation with Cocoa/ObjC and feels that it would be a better option than using NSTask, I'm completely open to that as well.
Thanks in Advance.