Quellcode durchsuchen

Add note about format

Marcin Krzyzanowski vor 2 Jahren
Ursprung
Commit
5858dee4b5
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      README.md

+ 2 - 0
README.md

@@ -563,6 +563,8 @@ let alicesPrivateKey = try RSA(keySize: 1024)
 let alicesPublicKeyData = try alicesPrivateKey.publicKeyDER()
 let alicesPublicKeyData = try alicesPrivateKey.publicKeyDER()
     
     
 // Bob receives the raw external representation of Alices public key and imports it
 // Bob receives the raw external representation of Alices public key and imports it
+// Use DER encoded format. Use openssl to convert between PEM and DER formats if needed,
+// eg.: openssl rsa -in <file_with_key> -inform PEM -out <new_der_key_file> -outform DER
 let bobsImportOfAlicesPublicKey = try RSA(rawRepresentation: Data(alicesPublicKeyData))
 let bobsImportOfAlicesPublicKey = try RSA(rawRepresentation: Data(alicesPublicKeyData))
     
     
 // Bob can now encrypt a message for Alice using her public key
 // Bob can now encrypt a message for Alice using her public key