Git Product home page Git Product logo

passkit4j's Introduction

passkit4j Build Status

Apple Passbook library for Java

  • Fluent API
  • Stream-oriented

Usage

Create a Pass Type ID in the iOS Provisioning Portal (if you haven't done so already), import the resulting pass.cer file into Keychain, then export it as a .p12 file. Download the Apple WWDR certificate.

In the code, create a PassSignerImpl object with these certificates:

PassSigner signer = PassSignerImpl.builder()
	.keystore(new FileInputStream("/path/to/certificate.p12"), "password")
	.intermediateCertificate(new FileInputStream("/path/to/AppleWWDRCA.cer"))
	.build();

Pass pass = new Pass()
	.passTypeIdentifier("pass.com.bouldercoffeeco.storeCard")
	.serialNumber("1a2b3c")
	.teamIdentifier("cafed00d");
	// ... for a full example see src/test/com/ryantenney/passkit4j/StoreCardExample.java

PassSerializer.writePkPassArchive(pass, signer, outputStream);

Maven

Current stable version is 2.0.1, which supports iOS 9 passes.

<dependency>
	<groupId>com.ryantenney.passkit4j</groupId>
	<artifactId>passkit4j</artifactId>
	<version>2.0.1</version>
</dependency>

Documentation

Javadocs are hosted at http://ryantenney.github.io/passkit4j/docs/


License

Copyright (c) 2012-2016 Ryan Tenney

Published under Apache Software License 2.0, see LICENSE

Rochester Made

passkit4j's People

Contributors

ryantenney avatar xavierhaas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

passkit4j's Issues

java.lang.ClassNotFoundException: org.bouncycastle.asn1.ASN1ObjectIdentifier

I get this exception while creating a pass:

Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/asn1/ASN1ObjectIdentifier
        at org.bouncycastle.operator.jcajce.JcaContentSignerBuilder.<init>(Unknown Source)
        at org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoGeneratorBuilder$NamedHelper.createContentSigner(Unknown Source)
        at org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoGeneratorBuilder.build(Unknown Source)
        at com.ryantenney.passkit4j.sign.PassSignerImpl.generateSignature(PassSignerImpl.java:100)
        at com.ryantenney.passkit4j.PassSerializer.writePkPassArchive(PassSerializer.java:61)
        at com.***.service.passbook.PassbookGeneratorServiceLocalServiceBean.generatePass(PassbookGeneratorServiceLocalServiceBean.java:153)
        at com.***.service.passbook.PassbookGeneratorServiceLocalServiceBean.createAndGeneratePass(PassbookGeneratorServiceLocalServiceBean.java:80)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
        at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
        at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
        at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
        at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
        at com.***.service.auditing.ServiceCallAuditingInterceptor.auditServiceCall(ServiceCallAuditingInterceptor.java:131)
        at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
        at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
        at sun.reflect.GeneratedMethodAccessor129.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
        at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
        at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
        ... 56 more
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.asn1.ASN1ObjectIdentifier
        at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:808)
        at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 91 more
|#]

Errors when downloaded the code

Hi,

When I downloaded the code i see a lot of errors in my code. in the following files. Please tell me how can I fix them.

PassSerializer.java
Color.java
DateField.java
NumberField.java
TextField.java
EventTicketExample.java
StoreCardExample.java

image

image

image

Versions of library dependencies

Hi!! I'm just trying to use your library in order to apply it to create passbooks. Some colleagues told me your library is the best implementation found. But I've realized that your library calls some other libraries, which I've found already, However, there are some troubles with some function calls, so I think it's all about version of the library imports. Then I want to ask you: which are the library versions you used in passkit4j of the following:

  • Fasterxml - Jackson

Failed to open pkpass file

The .pkpass file is generated but I am not able to open it on any device.There are no errors on eclipse console.

Mutiple Aliases Problem

Pass pass = new Pass()
            .teamIdentifier("asdfasdfasdf")
            .passTypeIdentifier("pass.com.bouldercoffeeco.storeCard")
            .organizationName("Boulder Coffee Co.")
            .description("Boulder Coffee Rewards Card")
            .serialNumber("p69f2J")
            .locations(
            new Location(43.145863, -77.602690).relevantText("South Wedge"),
            new Location(43.131063, -77.636425).relevantText("Brooks Landing"),
            new Location(43.147528, -77.576051).relevantText("Park Avenue"),
            new Location(43.155763, -77.612724).relevantText("State Street"),
            new Location(43.165389, -77.589655).relevantText("Public Market")
            )
            .barcode(new Barcode(BarcodeFormat.PDF417, "12345678"))
            .barcodes(
            new Barcode(BarcodeFormat.CODE128, "12345678"),
            new Barcode(BarcodeFormat.PDF417, "12345678"))
            .logoText("Boulder Coffee")
            .foregroundColor(Color.WHITE)
            .backgroundColor(new Color(118, 74, 50))
            .files(
            new PassResource("pkpass/pass.strings"),
            new PassResource("pkpass/icon.png"),
            new PassResource("pkpass/[email protected]"),
            new PassResource("pkpass/logo.png"),
            new PassResource("pkpass/[email protected]"),
            new PassResource("pkpass/strip.png"),
            new PassResource("pkpass/[email protected]")
             )
            .nfc(new NFC("test"))
            .passInformation(
            new StoreCard()
                    .headerFields(
                    new NumberField("balance", "balance_label", 25)
                            .textAlignment(TextAlignment.RIGHT)
                            .currencyCode("USD")
            )
                    .auxiliaryFields(
                    new TextField("level", "level_label", "level_gold"),
                    new TextField("usual", "usual_label", "Iced Mocha")
            )
                    .backFields(
                    new TextField("terms", "terms_label", "terms_value")
            )
    );

    PassSigner signer = PassSignerImpl.builder()
            .keystore(new   FileInputStream("pkpass/certificates/CertificatesD.p12"),"GD8R5W2JC7", "test")
            .intermediateCertificate(new    FileInputStream("pkpass/certificates/AppleWWDRCA.cer"))
            .build();
    PassSerializer.writePkPassArchive(pass, signer, new     FileOutputStream("passes/DemoCard.pkpass"));

I am using this code in my grails application.
I tried various scenarios like:

  • When i didnt pass the "GD8R5W2JC7" while creating pass signer it says: Provided KeyStore contains multiple aliases, please specify an alias
  • When i pass alias it says : KeyStore does not contain an X509Certificate with alias "The Alias i provided". I printed the alias for that certificate but no alias would work.

P.S I am using ubuntu 14.04.

Can't create passfile: PassSerializationException: Error closing output stream

If I call this PassSerializer.writePkPassArchive(pass, signer, byteOutputStream); I the following exception:

Caused by: com.ryantenney.passkit4j.PassSerializationException: Error closing output stream
        at com.ryantenney.passkit4j.PassSerializer.writePkPassArchive(PassSerializer.java:76)
        at com.***.service.passbook.PassbookGeneratorServiceLocalServiceBean.generatePass(PassbookGeneratorServiceLocalServiceBean.java:143)
        ... 85 more
Caused by: java.util.zip.ZipException: ZIP file must have at least one entry
        at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:304)
        at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:140)
        at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:321)
        at com.ryantenney.passkit4j.PassSerializer.writePkPassArchive(PassSerializer.java:74)
        ... 86 more
|#]

java.lang.NoSuchFieldError: data

`KeyStore keystore = KeyStore.getInstance("PKCS12");

keystore.load(p12File, "test".toCharArray());

PassSigner signer = PassSignerImpl.builder().keystore(keystore, "1").intermediateCertificate(new FileInputStream("AppleWWDRCA.cer")).build();`

I am using this code to create .pkpass file. But when I deploy to Weblogic, PassSignerImpl.builder(). line gives this error :

Caused by: java.lang.NoSuchFieldError: data
at org.bouncycastle.cms.CMSSignedGenerator.(Unknown Source)
at com.ryantenney.passkit4j.sign.PassSignerImpl.createGenerator(PassSignerImpl.java:136)
at com.ryantenney.passkit4j.sign.PassSignerImpl.(PassSignerImpl.java:128)
at com.ryantenney.passkit4j.sign.PassSignerImpl$Builder.build(PassSignerImpl.java:122)

#7 it looks like the same problem but i checked all the lib files and there is no duplicate or older version of any org.bouncycastle jar files.

I am not even sure if i need to add below dependency to my pom.xml :

<dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk16</artifactId> <version>1.46</version> </dependency>

Incompatibility with BouncyCastle 1.5x?

We've had some issues using passkit4j with the newest BouncyCastle library. The exception and stacktrace are pretty perplexing as well!

Core exception:

2016-06-14 20:49:02,479 ERROR (web.errors.GrailsExceptionResolver) VerifyError occurred when processing request: [GET] /our/mobile/app/endpoint/
Bad type on operand stack
Exception Details:
  Location:
    org/bouncycastle/cms/CMSSignedDataGenerator.generate(Ljava/lang/String;Lorg/bouncycastle/cms/CMSProcessable;ZLjava/security/Provider;Z)Lorg/bouncycastle/cms/CMSSignedData; @301: invokevirtual
  Reason:
    Type 'org/bouncycastle/asn1/ASN1ObjectIdentifier' (current frame, stack[2]) is not assignable to 'org/bouncycastle/asn1/DERObjectIdentifier'
  Current Frame:
    bci: @301
    flags: { }
    locals: { 'org/bouncycastle/cms/CMSSignedDataGenerator', 'java/lang/String', 'org/bouncycastle/cms/CMSProcessable', integer, 'java/security/Provider', integer, 'org/bouncycastle/asn1/ASN1EncodableVector', 'org/bouncycastle/asn1/ASN1EncodableVector', integer, 'org/bouncycastle/asn1/ASN1ObjectIdentifier', 'java/util/Iterator', 'org/bouncycastle/cms/CMSSignedDataGenerator$SignerInf' }
    stack: { 'org/bouncycastle/asn1/ASN1EncodableVector', 'org/bouncycastle/cms/CMSSignedDataGenerator$SignerInf', 'org/bouncycastle/asn1/ASN1ObjectIdentifier', 'org/bouncycastle/cms/CMSProcessable', 'java/security/SecureRandom', 'java/security/Provider', integer }
  Bytecode:

  ... <lots of hexdump> ...

Additional stack trace:

...
    at com.ryantenney.passkit4j.sign.PassSignerImpl.createGenerator(PassSignerImpl.java:136)
    at com.ryantenney.passkit4j.sign.PassSignerImpl.<init>(PassSignerImpl.java:128)
    at com.ryantenney.passkit4j.sign.PassSignerImpl$Builder.build(PassSignerImpl.java:122)
    at com.todaytix.cms.PassbookService.createPassForTransaction(PassbookService.groovy:115)
...

The core issue seems to be a change made for BouncyCastle 1.47, wherein DERObjectIdentifier was renamed to ASN1ObjectIdentifier.

@jessestuart has been troubleshooting a bit here at @TodayTix.

PassSignerImpl keystore error in unix deployment

Hello,

i have create console application on windows machine its working fine and able to create pass file from it.
i have done some changes for certificate reading,
KeyStore ks = KeyStore.getInstance("PKCS12");
InputStream ksIs = new FileInputStream("certificates/Certificates.p12");
try {
ks.load(ksIs, "1234".toCharArray());
} finally {
if (ksIs != null) {
ksIs.close();
}
}

    Enumeration aliases = ks.aliases();
    java.security.cert.Certificate cer = null;

    String keyAlias = "";
    while (aliases.hasMoreElements()) {
        keyAlias = (String) aliases.nextElement();
        System.out.print("Key Alias :::\n" + keyAlias + "\n");
        cer = ks.getCertificate(keyAlias);
        System.out.print("getType :::\n" + cer.getType() + "\n");
    }

    PassSigner signer = PassSignerImpl
            .builder()
            .keystore(
                    new FileInputStream("certificates\\Certificates.p12"),
                    "1234")
            .privateKeyAlias(keyAlias)
            .signingCertificate((X509Certificate) cer)
            .intermediateCertificate(
                    new FileInputStream("certificates\\AppleWWDRCA.cer"))
            .build();

    File objFileTemp = new File("testing");

Its working fine , but i deployed this code in unix machine, its giving below error as "com.ryantenney.passkit4j.sign.PassSigningException: Error loading PKCS12 KeyStore
at com.ryantenney.passkit4j.sign.PassSigningUtil.propagateAsPassSigningException(PassSigningUtil.java:161)"

is they any compatable issues

thanks
Shaik Abdullah

Do we have different loading of this jar in unix machine

Hi,
My code working fine in windows machine on java console application. When i integrated this jar files in web and deployed on unix machine iam getting yield errors on mostly certificate.

iam fetching certificate details locally(created virtual folder with certificate p12 and certificate) its working fine. But on unix its througing error.its reading certificate successfully, but

but in below code its throwing errors,
PassSigner signer = PassSignerImpl.builder().keystore(ks, "1234")
.privateKeyAlias(keyAlias)
.signingCertificate((X509Certificate) cer)
.intermediateCertificate((X509Certificate) cer).build();
LOG.debug("signer ready1");

Thanks
Shaik Abdullah

Public hosted API docs

I think it would be a good idea to generate the API docs for the current version and publish it so every one can read it easily within the internet.

Cert issue

If I export my p12 file the key and the cert have different alias. Is there another way to export my key or to fix the alias name? Because now the lib can load my certificate (Because the first alias is correct for the certificate) but not for my private key.

Help while signing

Hi

I'm getting this error :

passbookscala [ERROR] [08/22/2016 18:43:53.859] Provided KeyStore contains multiple aliases, please specify an alias
passbookscala com.ryantenney.passkit4j.sign.PassSigningException: Provided KeyStore contains multiple aliases, please specify an alias
passbookscala at com.ryantenney.passkit4j.sign.PassSigningUtil.firstAlias(PassSigningUtil.java:136)
passbookscala at com.ryantenney.passkit4j.sign.PassSigningUtil.getCertificate(PassSigningUtil.java:100)
passbookscala at com.ryantenney.passkit4j.sign.PassSignerImpl$Builder.build(PassSignerImpl.java:111)

java.lang.NoSuchMethodError: org.bouncycastle.asn1.ASN1Integer.<init>(I)V

Hi,

I am trying to run the example application.But when i run the program the below exception is occurred.Any idea ?
I am using java 1.6.0_25 with bouncycastle1.47 jars in classpath.

Exception in thread "main" java.lang.NoSuchMethodError: org.bouncycastle.asn1.ASN1Integer.(I)V
at org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder.createPSSParams(Unknown Source)
at org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder.(Unknown Source)
at org.bouncycastle.operator.jcajce.JcaContentSignerBuilder.(Unknown Source)
at org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoGeneratorBuilder$NamedHelper.createContentSigner(Unknown Source)
at org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoGeneratorBuilder.build(Unknown Source)
at com.ryantenney.passkit4j.sign.PassSignerImpl.createGenerator(PassSignerImpl.java:137)
at com.ryantenney.passkit4j.sign.PassSignerImpl.(PassSignerImpl.java:128)
at com.ryantenney.passkit4j.sign.PassSignerImpl$Builder.build(PassSignerImpl.java:122)

Empty String in value of TextField not render to json

if i do this:

primaryFields.add( new TextField( "Test key", "Test text", ""));

The json looks like:
"primaryFields" : [ {
"key" : "Test key",
"label" : "Test text",
"textAlignment" : "PKTextAlignmentLeft"
} ],

The right json should look like this:
"primaryFields" : [ {
"key" : "Test key",
"label" : "Test text",
"textAlignment" : "PKTextAlignmentLeft",
"value" : ""
} ],

Apple says The value field is required., otherwise the pass in invalid and i can't put it into passkit.

Failed to execute goal org.projectlombok:lombok-maven-plugin:0.12.0.0:delombok

Hi Ryan Tenney,
Greetings..!
I am new to Java development, using your library for generating the pass. Actually i need to disable "Share Pass" option for that added a Json property(sharingProhibited) in Pass.java file and trying to build a jar file, While building jar file using Maven (in Mac Eclipse) getting bellow error.

  1. Can you help me to resolve this error. (Adding lombok.jar in build path does not helped)
  2. Can you let me know how to return the .pkpass file to caller function, Because im using IBM mobile first JavaScript code to call the Java code, so i must return binary .pkpass to javascript.

Failed to execute goal org.projectlombok:lombok-maven-plugin:0.12.0.0:delombok (default) on project passkit4j: Execution default of goal org.projectlombok:lombok-maven-plugin:0.12.0.0:delombok failed: A required class was missing while executing org.projectlombok:lombok-maven-plugin:0.12.0.0:delombok: com/sun/tools/javac/main/OptionName

screen shot 2018-06-04 at 7 42 26 pm

Thanks in Advance

Keystore

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

Why we need to specify "BouncyCastleProvider.PROVIDER_NAME" in code?

I'm trying to install the project passkit4j but send me errors PassSerializer class

Hello

I am new in your comunity and , could you help me whith this: I am trying install the passkit4j project to create passes from java and sends me errors the PassSerializer class, the version that I have is Java 1.8.0_91, the errors are:

  • The method hash () is undefined for the type PassSerializer.OutputStreamHasher
  • The method passInformation () is undefined for the type Pass
  • The type PassSerializer.OutputStreamHasher must Implement the abstract method inherited OutputStream.write (int)

The pom file does not mark errors, I hope you can help me, thank you
excuse me for my English, I know it is very poor but I hope you understand me, thanks

image

Regards

KeyStore does not contain a PrivateKey

Hi!
I'm using your library to generate the pkpass file.
In the creation of the object "signer" PassSigner signer = PassSignerImpl I get the following error:
KeyStore does not contain a PrivateKey with aliases 'ALIAS'

I have declared the object like this:
PassSigner signer = PassSignerImpl
.builder()
.keystore(new FileInputStream("certificates/com.passbook.p12"),"Password")
.alias("ALIAS")
.intermediateCertificate(new FileInputStream("certificates/AppleWWDRCA.cer"))
.build();

Does anyone know that I may be missing?

Thank you.

Building pass in a jar file

Hi,

I've built a small java server app to build a pass with passkit4j on request.
When i debug the project, everything goes well, the problem comes when i build the jar file, when i try to execute the same method, i get "loading PKCS12 KeyStore".
This happens when i call PassSignerImpl.builder()

I've checked if every dependency was inside the jar, and everything look fine, did anyone around had a similar issue?

Thanks,
Bruno

Add field "ignoresTimeZone" in DateField.java

Hi

Following the Apple documentation
https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/FieldDictionary.html#//apple_ref/doc/uid/TP40012026-CH4-SW6

They added a ignoresTimeZone attribute for the DateField , but it's impossible to manipulate it as its not in defined in your library.
The main goal of this attribute is to tell the device to don't care of the timezone, as we give the good hour on our side.

Would it be possible to add that field to the class ?

Thanks

Xavier

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

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!!

Possible issue

Hey I found in the internet that some other API users complaining about that the pass doesn't work to import on a real device without the WWDR in the manifest file.

Can some one validate that if this issue exists with this implementation too? (I can't import at the moment a pass on a IPod with IOS6 but this could also be because my web service url is http instead of https)

http://stackoverflow.com/questions/12701230/passbook-pass-can-not-be-installed

Do you have support for AppLaunchUrl and AssociatedStoreIdentifiers?

Hello, first thanks for the good job on the library!
I have a questions, how can i use these properties from pass?
I put my app id in the AssociatedStoreIdentifiers, but in the back off the pass appear "Cannot load app details". Do you know why?
And the AppLaunchUrl, i put some examples url that work on my app, but i dont know when push. I think that the pass launch the url when the notification appear on the lock screen, but only open the pass. Do you try that?
Thanks for your help, i read the documentation and dont say anything about.

Fields don't have a no argument constructor.

With lombok you are generating simple getters and setters which return this instead of void, but since there isn't a no args constructor for fields we aren't able to make much use of them to improve readability of code.

Currently we have to do something like this to create a field:
new TextField("NAME","name","Jim Bob")

This could easily be improved to be more readable by simply adding a blank constructor. The code could be transformed into a more readable form like below, which would also allow us to take advantage of the way that you have setters created through lombok.
new TextField().label("NAME") .key("name") .value("Jim Bob")

Maven

Is this package in a maven repository? If no are there any plans to add it to a maven repository?

Why the update of bcmail-jdk15on?

I am wondering why you changed the bcmail-jdk15on version from 1.46 to 1.47 after the 1.0.0 release. This cause now issues again since the other org.bouncycastle libs we are using are not released in 1.47 on maven. If there is no important reason for that can you change it back?

How can i add localisation files

How can I add localisation files? Can I just specify new PassResource("en.lproj/pass.strings", myEnStringsFile); or is that not supported at the moment?

Document public key format

I will be useful to document the public key format. Or maybe insert something else than a string?

Thanks!

Why exactly one alias?

Why does the method PassSigningUtil.firstAlias require exactly one alias? I am trying to generate p12 files, but they are always generated with two aliases.

I can see the Passbook on my Computer just fine - but not on the iPhone

I have a sample created with Passk.it and it works fine when I email it to the iPhone.

I tried your sample and made the following changes:

  • commented out the webserviceURL & authenticationToken (since I do not have one)
  • added my teamIdentifier and passTypeIdentifier that I got from Apple when I created the Pass Type Identifier

I can preview the Pass on my Mac, but If I email it to my phone, it won't load. I can't download it in Safari either - even though the mime type is set.

How can I figure out what is wrong?

@Include.NON_DEFAULT doesn't work in newer versions of Jackson

We are running a later Jackson version on our application server and this is causing this library to be unusable due to this bug.

In the case of Location.altitude (which is optional), not setting a value results in the field not being ignored as it appears in the pass.json file:

{
"latitude" : 37.33182,
"longitude" : -122.03118,
"altitude" : "NaN"
}

This is not a valid format which results in the Wallet app not reading the pass.

I changed Include.NON_DEFAULT to Include.NON_NULL and set the default
altitude value to null. This results in the same behavior as before
the upgrade of Jackson.

I've created a pull request with a fix:
#43

Required third party jar files, Please someone mention it

Hello Ryan Sir and my other friends, I am new to this field and I want to generate passes using Java, so I want to know what all third party jar files, I will be needing in order to get the project working completely. I have tried running this project but it gives me PKCS12 Mac is invalid error but when run the command to generate passkey it displays Mac verified OK, so I am assuming there is some mistake with the jar files, I have included, Please help me out guys....

Update bouncycastle and jackson, current versions have known security issues

If one simply includes this library and does not handle dependencies probably (which is a pain with bouncycastle in any way) one ends up with outdated libraries :/

So could you please update the dependencies?

Details:

mvn org.owasp:dependency-check-maven:5.2.4:aggregate
....

One or more dependencies were identified with known vulnerabilities in Passkit4j:

jackson-databind-2.1.0.jar (pkg:maven/com.fasterxml.jackson.core/[email protected], cpe:2.3:a:fasterxml:jackson:2.1.0:*:*:*:*:*:*:*, cpe:2.3:a:fasterxml:jackson-databind:2.1.0:*:*:*:*:*:*:*) : CVE-2017-15095, CVE-2017-17485, CVE-2017-7525, CVE-2018-1000873, CVE-2018-11307, CVE-2018-14718, CVE-2018-14719, CVE-2018-14720, CVE-2018-14721, CVE-2018-19360, CVE-2018-19361, CVE-2018-19362, CVE-2018-5968, CVE-2018-7489, CVE-2019-14540, CVE-2019-16335, CVE-2019-16942, CVE-2019-16943, CVE-2019-17267, CVE-2019-17531
bcprov-jdk15on-1.47.jar (pkg:maven/org.bouncycastle/[email protected], cpe:2.3:a:bouncycastle:legion-of-the-bouncy-castle-java-crytography-api:1.47:*:*:*:*:*:*:*) : CVE-2013-1624, CVE-2015-6644, CVE-2015-7940, CVE-2016-1000338, CVE-2016-1000339, CVE-2016-1000341, CVE-2016-1000342, CVE-2016-1000343, CVE-2016-1000344, CVE-2016-1000345, CVE-2016-1000346, CVE-2016-1000352, CVE-2017-13098, CVE-2018-1000613

pubic methods for reading and writing pass.json

I would like to generate a Pass object from an existing pass.json, and equally I would like to generate the pass.json from a Pass object.

This way I can store the (unfinished/unsigned) pass somewhere, and retrieve it later before I finally build/sign it.

The PassSerializer.generatePass(...) method will almost do half of what I need. I just need a PassDeserializer as well.

I'm happy to fork and add the needed code if the suggestion is a good one.

Tomcat startup exception

Hello, not sure if it is really a passkit4j issue.

After adding passkit4j to our project we got errors when starting Tomcat.
Even after increasing the Xss value the issue was not solved. And it is strange as I've never seen such an error in any other project - the current project is not a really large project.

Did you ever recognize such an error? Any idea why problem came with passkit4? passkit4 is not really big; perhaps caused by the Maven dependencies?

Thanks, JC

{code}
Aug 15, 2014 4:38:15 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/magnoliaAuthor]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/magnoliaAuthor] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector]
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2112)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2059)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1934)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1900)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1317)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
{code}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.