7 releases (4 breaking)

0.5.0 Aug 6, 2024
0.4.0 Oct 5, 2023
0.3.0 Jan 21, 2022
0.2.2 Jan 21, 2022
0.1.0 Aug 1, 2021

#144 in macOS and iOS APIs

Download history 37/week @ 2024-07-14 12/week @ 2024-07-21 46/week @ 2024-07-28 136/week @ 2024-08-04 19/week @ 2024-08-11 1/week @ 2024-08-18 1/week @ 2024-08-25 2/week @ 2024-09-01 1/week @ 2024-09-08 15/week @ 2024-09-15 37/week @ 2024-09-22 28/week @ 2024-09-29 15/week @ 2024-10-06 5/week @ 2024-10-13 18/week @ 2024-10-20

69 downloads per month

MIT license

89KB
1.5K SLoC

wallet-pass

Latest version

Build and sign passes for apple wallet

Sign an exisiting pass

cargo build --release --features cli --bin signpass

./target/release/signpass --help

Create a custom pass

use std::path::Path;
use wallet_pass::{
    template::{Details, Field, Barcode, BarcodeFormat},
    Pass,
};

fn main() {
    // Load pass template
    let mut pass = Pass::from_path(Path::new("./StoreCard.pass")).unwrap();

    // Set general attributes
    pass.pass_type_identifier("pass.com.store.generic");
    pass.team_identifier("ASDF1234ASDF");

    // Set user specific attributes
    pass.serial_number("1234567890");
    pass.authentication_token("sda8f6ffDFS798SFDfsfSdf");

    pass.barcode(Barcode::new(BarcodeFormat::PkBarcodeFormatQr, "QR Code", "iso-8859-1"));

    let mut store_card = Details::new();

    let mut field = Field::new_f64("balance", 13.37);
    field.label("balance");
    field.currency_code("EUR");
    store_card.add_primary_field(field);

    let mut field = Field::new_string("account_name", "Max Mustermann");
    field.label("account_name");
    store_card.add_secondary_field(field);

    pass.store_card(store_card);

    // Sign, comprass and save pass
    pass.export_to_file(
        Path::new("Certificates.p12"),
        "Certificates Password",
        Path::new("Apple Worldwide Developer Relations Certification Authority.pem"),
        Path::new("./StoreCard.pkpass"),
    )
    .unwrap();
}

Dependencies

~9–19MB
~275K SLoC