Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple Wallet NFC encryptionPublicKey

In Apple's documentation for the keys available for a Wallet pass, there's an option for a dictionary for NFC-related data. I understand that use of this key requires special permission from Apple. Regardless ...

message is straight forward -- it's the data passed to a NFC terminal (usually a unique identifier for the customer).

encryptionPublicKey, however, has me confused. Apple states it is the public encryption key used by the Value Added Services protocol. Use a Base64 encoded X.509 SubjectPublicKeyInfo structure containing a ECDH public key for group P256.

Can anyone explain what this second sentence means and/or what a developer would have to do to generate this? From what would one even generate the public/private keys from?

like image 656
Dan Avatar asked Jan 25 '18 08:01

Dan


People also ask

Can you add NFC to Apple wallet?

Access your car, home, workplace, and hotel room with keys in Wallet on iPhone. In the Wallet app , you can store keys to your car, home, workplace, and hotel room. iPhone automatically presents the right key when you arrive at your door, allowing you to enter with just a tap using Near Field Communication (NFC).

What is Apple vas?

To transmit data from supported passes to compatible NFC terminals, Apple uses the Apple Value Added Services (Apple VAS) protocol. The VAS protocol can be implemented on contactless terminals or in iPhone apps and uses NFC to communicate with supported Apple devices.

How do I create a ticket on Apple wallet?

To create one yourself, open the Pass2U Wallet application, then either choose a template or start from scratch. Enter the relevant information, scan the barcode on your pass if necessary, and hit done. The app prompts you to add the pass to the Wallet app.


1 Answers

You'll need the following to generate the public and private key. The private key is used by the merchant hardware when reading the pass and decoding the payload.

The compressed public key is what goes into your pass.json.

openssl ecparam -name prime256v1 -genkey -noout -out nfcKey.pem
openssl ec -in nfcKey.pem -pubout -out nfcPubkey.pem -conv_form compressed
cat nfcPubkey.pem

Outputs:

-----BEGIN PUBLIC KEY-----
MDkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDIgAC/Bu9nyAtG1DQe7t7jszLb+dZ1GbX
oR8G0rIXoak67NM=
-----END PUBLIC KEY---

You'll need Base64 key (without the newline) for the encryptionPublicKey field.

E.g. MDkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDIgAC/Bu9nyAtG1DQe7t7jszLb+dZ1GbXoR8G0rIXoak67NM=

like image 190
PassKit Avatar answered Sep 25 '22 17:09

PassKit