Browse Source

Update documentation to use the new publicKeyExternalRepresentation

Maxence Mottard 2 năm trước cách đây
mục cha
commit
017e463a8f
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      README.md

+ 2 - 2
README.md

@@ -560,7 +560,7 @@ RSA Encryption & Decryption Example
 let alicesPrivateKey = try RSA(keySize: 1024)
     
 // Alice shares her **public** key with Bob
-let alicesPublicKeyData = try alicesPrivateKey.publicKeyDER()
+let alicesPublicKeyData = try alicesPrivateKey.publicKeyExternalRepresentation()
     
 // Bob receives the raw external representation of Alices public key and imports it
 let bobsImportOfAlicesPublicKey = try RSA(rawRepresentation: Data(alicesPublicKeyData))
@@ -591,7 +591,7 @@ let messageAliceSupports = "Hi my name is Alice!"
 let alicesSignature = try alicesPrivateKey.sign(messageAliceSupports.bytes)
     
 // Alice shares her Public key and the signature with Bob
-let alicesPublicKeyData = try alicesPrivateKey.publicKeyDER()
+let alicesPublicKeyData = try alicesPrivateKey.publicKeyExternalRepresentation()
     
 // Bob receives the raw external representation of Alices Public key and imports it!
 let bobsImportOfAlicesPublicKey = try RSA(rawRepresentation: Data(alicesPublicKeyData))