AppAttest -- Can a Swift program that uses DCAppAttestService be run on Linux?
0
votes
0
answers
119
views
I need to be able to run the code that issues an Apple **attest** but not on Apple OS -- on Linux. Or, at the very least, on a MacOS **VPS** -- not a **physical** device.
I'm aware that validation, verification of **attest-s** can, indeed, be run on Linux. This will the 2nd step. My question, however, about the code that issues, generates **attest-s** initially -- the 1st step.
---
https://developer.apple.com/documentation/devicecheck/dcappattestservice
import DCAppAttest
func generateKeyAndAttestation() {
guard let attestationKey = DCAppAttestService.shared.generateKey() else {
print("Error generating attestation key.")
return
}
// Generate a nonce (you may need to use a more secure source for your actual use case)
let nonce = Data.random(count: 32)
// Prepare the data to be attested
let dataToAttest = "Data to be attested".data(using: .utf8)!
// Concatenate nonce and data
var attestationData = nonce
attestationData.append(dataToAttest)
// Use DCAppAttestService to attest the data
guard let attestation = DCAppAttestService.shared.attestData(attestationData, withKey: attestationKey) else {
print("Error generating attestation.")
return
}
// Print or use the attestation key and the resulting attestation
print("Attestation Key: \(attestationKey)")
print("Attestation: \(attestation)")
}
I expect there to be new customers daily, therefore this code will be run regularly. Therefore, using an Apple **physical device** for this, if indeed required, will be inconvenient.
1) I haven't found a clear answer as to whether or not DCAppAttestService
must be run **only on** MacOS/iOS .
2) And whether or not it has to be a **physical** Apple device or will any VPS running one of the latest OSX do too?

Asked by barugaggi
(1 rep)
Jan 8, 2024, 02:02 AM
Last activity: Jan 8, 2024, 09:45 PM
Last activity: Jan 8, 2024, 09:45 PM