Home > Uncategorized > Creating Apple Passbook #PKPass coupons from Windows

Creating Apple Passbook #PKPass coupons from Windows

I was following the excellent tutorial by Marin Todorov at http://www.raywenderlich.com/20734/beginning-passbook-part-1 , to create passbook (.pkpass) files from the command line – in order to understand what was going on, rather than depending on third party services to generate them.

However, the tutorial requires a mac, so I adapted it to work from windows as follows;

Download GNUWIN32 http://sourceforge.net/projects/gnuwin32/

—–Generate CSR———-

openssl genrsa -out passbookprivatekey.key 2048

Had to use template openssl.conf (https://www.tbs-certificats.com/openssl-dem-server-cert-thvs.cnf)

set OPENSSL_CONF=%cd%\openssl.cnf

openssl req -new -key passbookprivatekey.key -out PassbookCSR.certSigningRequest -subj “/emailAddress=you@domain.com, CN=Company, C=GB”

> send to apple, and get pass.cer back.

—–Convert CER to P12—–

openssl x509 -inform der -in pass.cer -out pass.pem

openssl pkcs12 -export -out pass.p12 -inkey passbookprivatekey.key -in pass.pem

password XXXX
—- And finally, create signature —-

openssl pkcs12 -in pass.p12 -clcerts -nokeys -out passcertificate.pem -passin pass:XXXX

openssl pkcs12 -in pass.p12 -nocerts -out passkey.pem -passin pass:XXXX -passout pass:XXXX

Download Apple AppleWWDRCA.cer

openssl x509 -inform der -in AppleWWDRCA.cer -out AppleWWDRCA.pem

openssl x509 -inform der -in pass.cer -out pass.pem

openssl smime -binary -sign -certfile AppleWWDRCA.pem -signer passcertificate.pem -inkey passkey.pem
-in manifest.json -out signature -outform DER -passin pass:XXXX

Advertisements
Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: