ryantenney / passkit4j

Java library for generating Apple Passbook (.pkpass) files

Home Page:http://www.ryantenney.com/passkit4j/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I created the project using Ryan's PKPASS files, but I am finding one error in this field, I am attaching snapshot

Kavit900 opened this issue · comments

commented

screenshot from 2015-07-21 13 16 25

Please check out Project Lombok and how install it for eclipse: https://projectlombok.org/download.html

commented

Thanks ryan that solved the problem, now I am stuck at this step, Please help me out..
2

I'm afraid I can't help with generating PKCS12 keystores.
Perhaps this might help?
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

commented

Ryan Sir, I think the problem is coming when I call Keystore(Keystore,password) but there are two constructors and which one is getting called is giving the error. Just see once again at the error.
1

I'm sorry, you aren't providing me enough information to help you.

commented

Sir when I debuged the Program, I am getting stuck at this Part, And it says source not found at KeyStore keystore = KeyStore.getInstance(.....) , what could be reason, I think because I don't have correct bouncy jar files ??

static KeyStore loadPKCS12File(InputStream inputStream, String password) throws PassSigningException {
    ensureBCProvider();

    try {

        KeyStore keystore = KeyStore.getInstance("PKCS12", BouncyCastleProvider.PROVIDER_NAME);
        keystore.load(inputStream, chars(password));
        return keystore;

    } catch (Exception e) {
        throw propagateAsPassSigningException("Error loading PKCS12 KeyStore", e);
    } finally {
        try {
            if (inputStream != null) inputStream.close();
        } catch (IOException e) {}
    }
}

Clearly from the error you are receiving, the PKCS12 keystore file you are providing is invalid, thus "PKCS12 key store mac invalid". That is an error thrown by Bouncy Castle, not by Passkit4j.

commented

Ok so should I create another certificate on Apple store and then import it as .p12 and try it right Sir?

commented

Sir I when I am running this command - "openssl pkcs12 -in PassbookCert.p12 -clcerts -nokeys -out passcertificate.pem -passin pass:" then I get output - Mac verified OK then why it gives error when I provide path parameter to my java file for .p12 as Error loading PKCS12....

Sir for testing, do you have a Certificate.p12 file that you used for testing for EventExample.java and it worked, Can you upload it somewhere and paste the link here, I will try using that, I won't disturb you again Sir, Please Sir.

Thank You.

commented

Ryan Sir, I think I am near to the error, the KeyStorePassword that we pass to PassSigningUtil is the KeyStorePassword that we had given during creation of PassTypeID from Apple site or it is any password that we can give now while creating .pkpass. Please let me know, because I think I am giving wrong password that is causing the error.

Hello Kavit900,

I am also facing same issue.
Have you cracked this exception, if so could you please help in solving this.

commented

Hi @kaanusha, I had fixed it but it was 2 years back, the issue was about using wrong password, I will try to look whether I have kept the code with me or not, if was for a company and I currently don't work there.