瀏覽代碼

Add note about format

Marcin Krzyzanowski 2 年之前
父節點
當前提交
5858dee4b5
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      README.md

+ 2 - 0
README.md

@@ -563,6 +563,8 @@ let alicesPrivateKey = try RSA(keySize: 1024)
 let alicesPublicKeyData = try alicesPrivateKey.publicKeyDER()
     
 // 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))
     
 // Bob can now encrypt a message for Alice using her public key