I'm having problems with the generated certificate, which I use to connect to apple push services. Everything works fine when the generated p12 file was in my src / main / java folder, but I moved it to src / main / resources and decided to stop working with the following error:
DerInputStream.getLength(): lengthTag=111, too big.
For more information: I use the notnoop push notifications library and follow the Ray Wenderlich manual to create certificates. after that I used the following commands to create a p12 file for use in java:
openssl x509 -in aps_development.cer -inform DER -out aps_development.pem -outform PEM openssl pkcs12 -nocerts -in single.p12 -out single.pem openssl pkcs12 -export -inkey single.pem -in aps_development.pem -out dual.p12
after that I moved double.p12 to my java project. First, the file was in the / src / main / java folder, say, in com.company.push.certificates (while the code requesting the file is in com.company.push ). I am requesting input using
InputStream stream = this.getClass().getResourceAsStream("certificates/dual.p12");
This works great in development, but not when creating a project (using maven), so I moved the resource to the resource folder using the same package. The resource is still found, but now I get the above java.io.IOException
Does anyone know what could be causing this?
Ps: when I move the file back to the package in src / main / java everything works fine, so the certificate seems to be valid.
Kevin r
source share