I'm currently working on an application that collects information from text fields in an OS X application, then access the openssl binary to generate a CSR and a Private Key based on those text fields. Here is the current code
let keySizeValue = keySizes[keySizeChoice.indexOfSelectedItem]
mainTask.launchPath = "/usr/bin/openssl"
mainTask.arguments = ["req", "-new", "-newkey", "\(keySizeValue)", "-passout", "pass:\(privateKeyPassword.stringValue)","-keyout", "/Users/\(userName)/Desktop/Certs/\(privateKeyText.stringValue).key", "-subj" ,"\"/C=US/ST=\(stateText.stringValue)/L=\(cityText.stringValue)/O=\(organizationText.stringValue)/OU=\(departmentText.stringValue)/CN=\(commonNameText.stringValue)\"", "-out", "/Users/\(userName)/Desktop/Certs/MyNew.csr"]
let pipe = NSPipe()
mainTask.standardInput = pipe
mainTask.launch()
mainTask.waitUntilExit()
mainTask.terminate()
However i'm getting an error that states that Subject does not start with '/'
. Was hoping someone could hit me up with some sort of idea as to why it is stating that my subject is not starting with that /, even though it clearly is.
Thanks all