Closed adrienafl closed 5 years ago
Hi! I'll try to do my best to help you!
Do you have ./certs
folder with the files, do you?
The Certificate
variable is okay.
The error is related to a bad-formatted PEM file. You have to check if the content of the keys.
Try to execute this command on the signerkey.pem
and signercert.pem
and see if they have any content.
$ openssl x509 -in filename.pem -noout -text
Which procedure did you follow to get the two files? The one for macOS or the one not for macOS? Or can you upload the two files here?
Thanks for your quick answer. I notices that the signerkey.pem is wrong. Are you sure about the command to generate it ?
I successfuly read the signercert.pem and wwdr.pem and to read the signerKey I used
openssl rsa -in signerKey.pem -text
and it worked
And to generate the file I used
$ openssl pkcs12 -in Certificates-pass.p12 -nocerts -out signerKey.pem -passin pass:1234 -passout pass:password
Returns
MAC verified OK
[Edited since I found the appropriate command to read the file generated]
To decrypt I used
$ openssl x509 -in signerKey.pem -passin pass:password
Returns
For information the result is : unable to load certificate 4677650028:error:09FFF06C:PEM routines:CRYPTO_internal:no start line:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.230.1/libressl-2.6/crypto/pem/pem_lib.c:683:Expecting: TRUSTED CERTIFICATE
Thanks for helping.
PS : I successfully generate my passes with the signpass binary provided by apple so my guess is a wrong key transformation for usage with the lib
Ok, I changed something I just don't know why but now it's working...
Thanks !
Well, yeah, I'm sure about the command. You used the "non-macOS-steps", right? Because the command you told me you used, is the same I putted in the "macOS steps". I'd like to better understand for the future. 😊
Hi! I have the same problem.
My code is :
let pass = new PKPass(
{
model: './card.pass',
icon: './public/images/icon.png',
icon2x: './public/images/icon@2x.png',
logo: './public/images/logo.png'
},
{
wwdr: './certs/wwdrr.pem',
signerCert: './certs/signercert.pem',
signerKey: './certs/signerkey.pem'
}
);
pass.type = 'storeCard';
pass
.getAsStream()
.then((stream) => {
console.log(stream);
})
.catch((err) => {
console.log(err);
});
The error is
Error: Invalid PEM formatted message. at Object.pem.decode (/Users/aitor/Documents/Tangram Publicidad y YOYO/tarjetas-virtuales/virtual-card/node_modules/node-forge/lib/pem.js:192:11)
I execute this command openssl x509 -in filename.pem -noout -text
The signerKey.pem not working.
Any clue ? Thanks
Hey @Aitorgb, this is a quite-old thread. Also, I'm not sure which version of passkit-generator are you using. That seems a hybrid of v2 and v3. I suggest you look at examples, read the documentation I wrote in the wiki, and all the docs available. If you still have issues, please open another issue thread and we can talk about it there. 😉
Hint: Passkit-generator v3 does not support paths for certificates. Hint2: try to run examples with your data, so you can be sure your certificates are working
@Aitorgb Hi did u manage to bypass this? because im facing same issue now signerKey is not opening and it has issue
Hi !
I'm trying to use your lib but I'm not able to get it working.
I try to run a basic example
I get the following error :
I tried to log the Certificate object created before readind :
{ _raw: { wwdr: './certs/wwdr.pem', signerCert: './certs/signercert.pem', signerKey: { keyFile: './certs/signerkey.pem', passphrase: 'pass' } } }
Any clue ? Thanks