I’m not 100% sure what you’ve done to create that
apple-app-site-association
file but there’s definitely something wonky about it. In general, I should be able to sign the JSON file in the standard way and then extract it using the
cms
subcommand of the
security
command. For example:
$ # Sign in the standard way.
$
$ openssl smime -sign -nodetach -in unsigned.json -out apple-app-site-association -outform DER -inkey private-key.pem -signer certificate.pem
$
$ # Extract as cms.
$
$ security cms -D -i apple-app-site-association -o extracted.json
$
$ # They're the same!
$
$ cmp unsigned.json extracted.json ; echo $?
0
That doesn’t work in your case:
$ curl -O -s https://m.catchoftheday.com.au/apple-app-site-association
$ security cms -D -i apple-app-site-association -o extracted.json
security: failed to add data to decoder: UNKNOWN (-8183(d)
security: problem decoding
Either you signed the file incorrectly or the data got corrupted when you uploaded it to your server.
The standard approach to signing these files is outlined in WWDC 2015 Session 509 Seamless Linking to Your App. I suggest you re-sign the file then check it locally with
security cms
. Then upload it to your server, download it, and verify that the uploaded and downloaded files are equal.
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"