Closed Salam-pc closed 1 year ago
Steps to generate signatures/keys/certificates from scratch:
final signer = Signer(
wwdrPem: wwdrPem, // this is File class that represents wwdrPem key
certificateP12: certP12, // this is File class representing .p12 key
directory: certificates, // output directory where signer should create signature in the future
);
await Future.wait([
signer.generateKey(),
signer.generateCertificate(), // there is also a possibility to specify password key (argument)
]);
Example manifest file (it is containing sha1 hashes of the files to verify integrity) https://github.com/WebEferen/flutter_wallet_card/blob/master/test/fixtures/example_passkit/manifest.json
For manifest generation you can also use Creators
helper (and it's create manifest method):
https://github.com/WebEferen/flutter_wallet_card/blob/0b65916ba0d22844bd6cee7ea5e0b825384b6673/lib/core/creators.dart#L21
final manifest = File(....);
await signer.generateSignature(manifest: manifest);
final outputDirectory = Directory(...);
final passkit = Passkit(directoryName: outputDirectory.path);
final generated = await passkit.generate(
id: 'some_id',
pkpass: pkpass, // You should also have pkpass file already generated
directory: outputDirectory,
signature: signaturePath, // Path to the previously generated signature
manifest: manifestPath, // Path to the previously generated manifest
passkitPass: passkitPath, // Path to the passkit file
);
For reference you can follow the test suite (to see how it works under the hood):
Best, Mike.
Thank you for your assistance when I had a question. Your help was greatly appreciated!
can you pls add an example for Generate from scratch method . i'm getting false for FlutterWalletCard.addPassKit(samplefile) and don't know where is the issue