Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Code=1 "Manifest signature did not verify successfully" #71

Closed
FranCoulibaly opened this issue Aug 26, 2019 · 2 comments
Closed

Code=1 "Manifest signature did not verify successfully" #71

FranCoulibaly opened this issue Aug 26, 2019 · 2 comments

Comments

@FranCoulibaly
Copy link

FranCoulibaly commented Aug 26, 2019

I've been trying to figure this out for a few days now.
The .pkpass appears to build correctly however, when I drag it into Simulator the following errors are logged in Console
-CMS verification error: -26275
-Signature validation: *** FAILED ***
-Invalid data error reading pass pass.com.example.pass/XXXXX. Manifest signature did not verify successfully
-Error Domain=PKPassKitErrorDomain Code=1 "The pass cannot be read because it isn’t valid." UserInfo={NSLocalizedDescription=The pass cannot be read because it isn’t valid., NSUnderlyingError=0x60000086e6d0 {Error Domain=PKPassKitErrorDomain Code=1 "Manifest signature did not verify successfully" UserInfo={NSLocalizedDescription=Manifest signature did not verify successfully}}}.

When I unpack the .pkpass, the signature.exe file is there but it is completely empty.
I can see that its loading the signing key file but then it never seems to get validated.

Code is as follows:

let template = passbook('coupon', {
   formatVersion : 1,
    passTypeIdentifier: 'pass.com.example.pass',
    teamIdentifier: 'XXXXXXX',
    webServiceURL : "https://example.com",
    authenticationToken : "1234567",
    organizationName: 'Test',
    description: 'example pass'
  });
template.loadImagesFrom('./images');
template.fields.barcode = {
      'format': 'PKBarcodeFormatPDF417',
      'message': '123456789',
      'messageEncoding':'iso-8859-1'
  };
template.fields.serialNumber = 'E5982H-I2';
template.keys('./keys', 'password');
let pass = template.createPass({
  primaryFields: [
    {
      key: "pass",
      label: "Project",
      value: "please work"
    }
  ]
});
var file = fs.createWriteStream("Callsheet.pkpass");
pass.on("error", function(error) {
  console.error(error);
  process.exit(1);
})
pass.pipe(file);
app.get("/newpass", function(request, response) {
  pass.render(response, function(error) {
  if (error)
   console.error(error);
 });

});

In the keys folder I have AppleWWDRCA.cer, Certificates.p12, com.example.pass.pem and wwdr.pem

I'm not sure if this is a bug or something I have done incorrectly (most likely the latter) but any help would be much appreciated

@FranCoulibaly
Copy link
Author

I have changed the get request to this, and the signature is no longer empty however the error is still the same

app.post("/callsheet", function(request, response) {
  var file = fs.createWriteStream("callsheet.pkpass");
  pass.on("error", function(error) {
    console.error(error);
    process.exit(1);
  })
  pass.pipe(file);
   console.log("post request sent");
  pass.render(response, function(error) {
  if (error)
   console.error(error);
 });

});

@FranCoulibaly
Copy link
Author

FranCoulibaly commented Aug 27, 2019

Fixed using

var signature = stdout.split(/\r\n|\n\n/)[3];

as per pull request #70

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant