Skip to content

sprhawk/Passbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

ypassbook - an Apple Passbook pass generator

Usage

  1. install: easy_install ypassbook easy_install M2Crypto

  2. Learn required infomation from Apple

  3. In your Keychain Access, export your Pass certificate into .p12 file (like pass.com.your.cert.p12), and Apple Worldwide Developer Relations certificate into .pem file (like AppleWWDR.pem)

  4. Convert your p12 files into PEMs:

    openssl pkcs12 -in "pass.com.your.cert.p12" -clcerts -nokeys -out "pass.com.your.cert.pem"
    openssl pkcs12 -in "pass.com.your.cert.p12" -nocerts -out "pass.com.your.key.pem"
  1. Create your pass object and save it into a .pkpass file.
    p = Pass(Pass.EVENTTICKET, description, organizationName, passTypeId, teamId, serialNumber)
    f = Field(key, value, label)
    p.addPrimaryField(f)
    p.setLocalizedString(locale, label, labelValue)

    imagename = "icon.png" #must be icon.png
    p.setImage(imagename, imagedata)

    p.logoText = "Your logo text"

    p.addLocation(latitude, longitude, altitude, name)

    p.setBarcode(Pass.PKBARCODE_FORMAT_QR, Pass.BARCODE_ENCODING_ISO_8859_1, value, text)

    # you can use p.savePackage() to save a Pass directory

    zipdata = p.getSignedPass(wwdr_data, cert_data, key_data, Passphrase)
    
    open("test.pkpass", "wb").write(zipdata) #save your pkpass file or send the data to your client
see test.py and testpass.py as an example

python pypi url: http://pypi.python.org/pypi/ypassbook

About

A Passbook toolkit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages