23.4. Preparing Your Passes for Digital Signature
Problem
You want to prepare your passes for digital signature. This is the step that you have to take before you are able to digitally sign your passes.
Solution
Create a file named manifest.json in the same folder where you placed your pass.json and your pass images. The manifest file will be a JSON file. Its root object is a dictionary. The keys to the dictionary are the names of the files (all your images, plus the pass.json file). The value of each key is the SHA1 hash of the file.
Discussion
Simply create the manifest.json file with the keys for all your images and leave the values empty for now. Your manifest.json file’s contents should look similar to what’s shown here:
{
"background.png" : "",
"background@2x.png" : "",
"background-568@2x.png" : "",
"icon.png" : "",
"icon@2x.png" : "",
"logo.png" : "",
"logo@2x.png" : "",
"pass.json" : "",
"thumbnail.png" : "",
"thumbnail@2x.png" : ""
}Now off to do the interesting part. We have to calculate the SHA1 hashes of all these files. Remember that every time you change the files from now on (for instance, if you find an issue with the pass.json file), you will have to recalculate the SHA1 hash and place the new SHA1 value in the manifest.json file. In order to calculate the SHA1 hash of any file in OS X, simply follow these steps:
Open up Terminal and navigate to the folder where the target file sits, using the
cdcommand.Issue an openssl command in Terminal. Pass
sha1as the first argument ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access