alexandercerutti / passkit-generator

The easiest way to generate custom Apple Wallet passes in Node.js
MIT License
893 stars 109 forks source link

Cannot proceed with pass creation due to bad keys format in overrides. #146

Closed midoshawky closed 1 year ago

midoshawky commented 1 year ago

Running OS

Mac OS Ventura 13.3.1

Running Node Version

v19.9.0

Description

im trying to generate the pass from any example but it ended with this message in the response "Cannot proceed with pass creation due to bad keys format in overrides." this is some of the error stack

at Pass._parseSettings (/Users/muhammedshawky/Downloads/passkit-generator-master/src/pass.js:675:10)
at new Pass (/Users/muhammedshawky/Downloads/passkit-generator-master/src/pass.js:44:28)
at manageRequest (/Users/muhammedshawky/Downloads/passkit-generator-master/examples/barcode.js:18:13)

i tried every thing and made sure about the certificates also

Expected behavior

it should generate the pkpass normally as every one did :"D

Steps to reproduce

just the same process of the example

Were you able to verify it by using (and changing) the examples?

If yes, which changes did you apply?

Other details

alexandercerutti commented 1 year ago

Hey there @midoshawky, thanks for using passkit-generator!

Can you please tell me which version of passkit-generator are you using?

Thanks

midoshawky commented 1 year ago

Hi @alexandercerutti thanks for replying Im using the latest 3.1.9

alexandercerutti commented 1 year ago

Are you sure, @midoshawky ? I do not recognize that file pass.js not _parseSettings functions. May that belong to a previous version? I honestly do not remember...

midoshawky commented 1 year ago

yeah i just cloned and follow the readme of the examples changed the team id and the passTypeIdentifier in pass.json and added the certificates

Screenshot 2023-06-20 at 10 55 28 AM

alexandercerutti commented 1 year ago

Do you mind sharing some code?

midoshawky commented 1 year ago

Yeah sure here is

Pass.json

{
  "formatVersion": 1,
  "passTypeIdentifier": "*******",
  "serialNumber": "nmyuxofgna",
  "teamIdentifier": "*******",
  "locations": [
    {
      "longitude": -122.3748889,
      "latitude": 37.6189722
    },
    {
      "longitude": -122.03118,
      "latitude": 37.33182
    }
  ],
  "barcodes": [
    {
      "message": "123456789",
      "format": "PKBarcodeFormatQR",
      "messageEncoding": "iso-8859-1"
    }
  ],
  "barcode": {
    "message": "123456789",
    "format": "PKBarcodeFormatQR",
    "messageEncoding": "iso-8859-1"
  },
  "organizationName": "Bumpy",
  "description": "Apple Event Ticket",
  "foregroundColor": "rgb(255, 255, 255)",
  "backgroundColor": "rgb(60, 65, 76)",
  "eventTicket": {
    "primaryFields": [
      {
        "key": "event",
        "label": "EVENT",
        "value": "The Beat Goes On"
      }
    ],
    "secondaryFields": [
      {
        "key": "loc",
        "label": "LOCATION",
        "value": "Moscone West"
      }
    ]
  }
}

Here is the first lines of barcode.js

app.all(function manageRequest(request, response) {

let passName = request.params.modelName + "_" + (new Date()).toISOString().split('T')[0].replace(/-/ig, "");

let pass = new Pass({
    model: `./models/${request.params.modelName}`,
    certificates: {
        wwdr: "./certificates/wwdr_certificate.pem",
        signerCert: "./certificates/signer_certificate.pem",
        signerKey: {
            keyFile: "./certificates/signer_key.pem",
            passphrase: "0123456789"
        }
    },

});

if u can tell me what exactly u need me to share too @alexandercerutti

alexandercerutti commented 1 year ago

@midoshawky please note that you don't have to set the paths for certificates but you have to read them first or set their content.

midoshawky commented 1 year ago

Sorry @alexandercerutti i didn't get that u mean to read the certificate data with some openssl commands and then put it there ? can u explain more because i just followed the example instrucations

alexandercerutti commented 1 year ago

I mean to use fs module to read the file or to use something like a process.env variable to get their content

midoshawky commented 1 year ago

ummm got you so the issue is releated to the certificates it self nothing more right ?

and if i can ask u a favor if u please can generate me a one with nfc enabled i will be so grateful while im just try to figure out how to fix because im just doing that so that i make the nfc enabled because i tried other packages was generating normally but nfc was not suprorted

alexandercerutti commented 1 year ago

@midoshawky that's the only wrong thing I see right now.

I can't generate an NFC pass right now and I won't be able any time soon, I'm sorry.

midoshawky commented 1 year ago

okay nvm thanks any way for your efforts @alexandercerutti

alexandercerutti commented 1 year ago

Let me know if you are able to solve after changing the way you read the certificates.

midoshawky commented 1 year ago

okay sure

midoshawky commented 1 year ago

I managed to skip this issue by using the correct way described in the documentation faced some other issues but was able to fix it currently facing something new :") so I guess we should close this one now thanks for your time @alexandercerutti

alexandercerutti commented 1 year ago

Great to know @midoshawky!

It would be awesome if you could leave a ⭐️ on the project if you already didn't. They are really important for me.

midoshawky commented 1 year ago

@alexandercerutti sure