SwiftyRSA
SwiftyRSA copied to clipboard
Added macOS 10.12 compatibility
Regarding #41
- Adds macOS target and respective testing target to the project.
- Uses new SecKey API for macOS to accomplish encryption, decryption, signature, and verification.
Select the macOS scheme and run the unit tests to make sure they all succeed on your device, as they (mostly) do on mine.
I added #TODO
where I think there's room for improvement in my changes. Please let me know what else I can do to help out! (Also don't forget to add macOS to the podspec.)
Hi saoudrizwan, I used your idea with the new APs SecKeyCreateDecryptedData in your PR and applied for iOS but it doesn't work. Something like this
public func decryptedNew(with key: PrivateKey) throws -> ClearMessage {
var error: Unmanaged<CFError>? = nil
let decryptedData = SecKeyCreateDecryptedData(key.reference, .rsaEncryptionOAEPSHA256, self.data as CFData, &error)
guard let unwrappedData = decryptedData as Data? else {
throw SwiftyRSAError.keyRepresentationFailed(error: error?.takeRetainedValue())
}
return ClearMessage(data: unwrappedData)
}
@saoudrizwan . We are merging quiet a few PR that alter the project structure, so gonna close this PR for now given this has been so old. But please feel free to reopen if still relevant.