Paccor does not provide a reasonable message when it cannot read the EC.
The stack trace below shows the error returned for the problem described in Issue #6. The fix proposed in that issue would handle situations similar to the case we saw for that issue. It could still not represent a valid EC.
Better errors will help when paccor is not able to process the EC. pc_certgen.sh should not reach the validation step if a platform certificate is not created.
Generating a signed Platform Credential
Exception in thread "main" org.bouncycastle.openssl.PEMException: problem parsing cert: java.io.IOException: Extra data detected in stream
at org.bouncycastle.openssl.PEMParser$X509CertificateParser.parseObject(Unknown Source)
at org.bouncycastle.openssl.PEMParser.readObject(Unknown Source)
at cli.DeviceObserverCli.handleCommandLine(DeviceObserverCli.java:66)
at cli.SigningCli.handleCommandLine(SigningCli.java:100)
at cli.SigningCli.main(SigningCli.java:192)
Caused by: java.io.IOException: Extra data detected in stream
at org.bouncycastle.asn1.ASN1Primitive.fromByteArray(Unknown Source)
at org.bouncycastle.cert.CertUtils.parseNonEmptyASN1(Unknown Source)
at org.bouncycastle.cert.X509CertificateHolder.parseBytes(Unknown Source)
at org.bouncycastle.cert.X509CertificateHolder.<init>(Unknown Source)
... 5 more
Validating the signature
File "/opt/paccor/scripts/pc_testgen/platform_cert.20181005074720.crt" does not exist.
PC Credential Creation Complete.
Platform Credential has been placed in /opt/paccor/scripts/pc_testgen/platform_cert.20181005074720.crt