login about faq

Hi,

I'v retrieved my certificate and now i'm trying to use the function that saves the private key to various format (in Objective-C) (Xcode) as follows:

CkoPrivateKey *privKey = 0;

privKey = [cert ExportPrivateKey];
if (privKey == nil ) {
    NSLog(@"%@",cert.LastErrorText);
    return;
}

if(privKey)
    NSLog(@"TRUE");
NSLog(@"Private Key: %@", privKey);

//  Export to various formats:

//  XML (unencrypted)
//path = @"/Users/user/Desktop/ChilkatKeys/PrivateKey/chilkat.xml";
success = [privKey SaveXmlFile: @"/Users/user/Desktop/ChilkatKeys/PrivateKey/private_key.xml"];
if (success != YES) {
    NSLog(@"%@",privKey.LastErrorText);

    return;
}

but i get the following error:

2015-03-08 23:33:02.252 CertificateChilkat[3369:1480558] ChilkatLog: SaveXmlFile: DllDate: Jan 22 2015 ChilkatVersion: 9.5.0.47 UnlockPrefix: NONE Architecture: Little Endian; 64-bit Language: IOS Objective-C VerboseLogging: 0 xmlPath: /Users/user/Desktop/ChilkatKeys/PrivateKey/private_key.xml pathQP: /Users/user/Desktop/ChilkatKeys/PrivateKey/private_key.xml fopen_failed: errno: 2 osErrorMessage: No such file or directory Failed to open file. mode: w path: /Users/user/Desktop/ChilkatKeys/PrivateKey/private_key.xml --fopen_failed filename: /Users/user/Desktop/ChilkatKeys/PrivateKey/private_key.xml Failed to write complete file (7) Failed. --SaveXmlFile --ChilkatLog

I don't know whats the problem, even though i've created the path and changed its permission into "Read/Write" Can someone please help me!!!

Best Regards.

asked Mar 08 '15 at 16:45

rania's gravatar image

rania
45182228

edited Mar 08 '15 at 16:50

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×34

Asked: Mar 08 '15 at 16:45

Seen: 882 times

Last updated: Mar 08 '15 at 16:50

powered by OSQA