Browse Source

clear code

Marino Faggiana 7 years ago
parent
commit
aa2b06d046
1 changed files with 15 additions and 0 deletions
  1. 15 0
      iOSClient/Security/NCEndToEndEncryption.m

+ 15 - 0
iOSClient/Security/NCEndToEndEncryption.m

@@ -52,6 +52,8 @@
 #define fileNameCertificate         @"e2e_cert.pem"
 #define fileNameCSR                 @"e2e_csr.pem"
 #define fileNamePrivateKey          @"e2e_privateKey.pem"
+#define fileNamePubliceKey          @"e2e_publicKey.pem"
+
 
 @implementation NCEndToEndEncryption
 
@@ -202,6 +204,19 @@ cleanup:
     fclose(f);
     */
     
+    // PublicKey
+    /*
+     NSString *publicKeyPath = [NSString stringWithFormat:@"%@/%@", directoryUser, fileNamePubliceKey];
+     f = fopen([publicKeyPath fileSystemRepresentation], "wb");
+     if (PEM_write_PUBKEY(f, pkey) < 0) {
+     // Error
+     fclose(f);
+     return NO;
+     }
+     NSLog(@"Saved publicKey to %@", publicKeyPath);
+     fclose(f);
+     */
+    
     // Here you write the private key (pkey) to disk. OpenSSL will encrypt the
     // file using the password and cipher you provide.
     //if (PEM_write_PrivateKey(f, pkey, EVP_des_ede3_cbc(), (unsigned char *)[password UTF8String], (int)password.length, NULL, NULL) < 0) {