can we create a pass (.pkpass file) programmatically in Xcode?

Although we can add the transfer to the pass application in iOS 6.0 programmatically, if we have a .pkpass file in the document directory or we get it from the server. But I was looking for all the Apple documentation, which shows the steps for creating a .pkpass file manually.

It is possible to create a .pkpass file programmatically using Xcode.

+5
source share
1 answer

The .pkpass file consists of several components. The most complex component that must be executed programmatically is the signature of the manifest file. The remaining parts are trivially assembled on the iPhone platform programmatically. You may notice that the Apple documentation uses a shell command to calculate this value using the OpenSSL library. I had to manually write a function that signed manifest files using the OpenSSL C library, however this is not trivial due to the lack of examples and the complexity of the library. Apple's signature function for the manifest is not in their CommonCrypto structure.

In addition, in order to sign these badges on the phone, credentials must be present in a binary package or compiled assets, which is probably not a good idea for distribution if you want to protect the integrity of your profile and sign your identity.

So, in short: this is certainly possible and feasible using existing specifications and libraries. However, I would not recommend doing this over the phone. This is quite complex and can lead to security risks if they are not properly implemented. In addition, if you include the OpenSSL library in your binary, you must tell Apple that you use encryption on your device and must register with ERN with the government. There may also be other export conditions for your code depending on your location (but, of course, I'm not a lawyer, so this is an assumption).

+10
source

Source: https://habr.com/ru/post/1439292/


All Articles