The WWDC 2021 CloudKit session talked about the new encryptedValues
field on CKRecord. It also indicated that CKAssets have already been end-to-end encrypted in previous releases. The documentation indicates that for encrypted values such as these:
CloudKit encrypts the fields’ values on-device before saving them to iCloud, and decrypts the values only after fetching them from the server. The encryption keys are available exclusively to the record’s owner and, if the user shares the record, that share’s participants.
For a client that is accessing CloudKit via the HTTP interface, the documentation indicates that assets have a downloadURL
property which can be used to fetch the asset. Does this URL download the already-decrypted asset? Or does it need to be encrypted after downloading?
If the asset is already decrypted at the time it is downloaded, how can this work, since as I understand it the key should not even be available to Apple. If the asset is not decrypted at that point, is there documentation about how we need to decrypt it?