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

com.ryantenney.passkit4j.sign.PassSigningException: Error loading PKCS12 KeyStore

kaanusha opened this issue · comments

Hello,

I am using ryantenney.passkit4j to create pkpass in windows machine.
when i am using the below code, I am getting PassSigningException: Error loading PKCS12 KeyStore.
And I have all the required files, .p12 and appleww.cer in place and password is also correct.

signer = PassSignerImpl.builder() .keystore(new FileInputStream(certificate.getPath()),"12345") .intermediateCertificate(new FileInputStream(appleCer.getPath())) .build();

I think, exception is thrown by this method of passkit.
`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) {}
	}
}`

Could you please help me in solving this issue asap, as deadline for this implementation is very near :(

Thank you!!

I'm sorry, I'm afraid I can't provide support for KeyStore as it is a part of the Java Runtime Library and not part of this library. If you do have any questions about using this library, please don't hesitate to ask.

Thank you @ryantenney

But i am not writing this keystore code, i am getting exception when i am using ryantenney passkit to call the below lines of code.
signer = PassSignerImpl.builder() .keystore(new FileInputStream(certificate.getPath()),"12345") .intermediateCertificate(new FileInputStream(appleCer.getPath())) .build();

Could you please tell me what can i do to solve this. Am i sending anything wrong as input?