Plugin signing fails when reading private key

Planned

When i try to sign a plugin using Gradle following the exact (maybe that is the problem) steps written in the 'Plugin signing' section, and it seems to encounter a problem reading my cert/private key, potentially because of formatting.
This is the exception:

Exception in thread "main" org.bouncycastle.pkcs.PKCSException: unable to read encrypted data: failed to construct sequence from byte[]: Extra data detected in stream
at org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo.decryptPrivateKeyInfo(Unknown Source)
at org.jetbrains.zip.signer.signer.PrivateKeyUtils.extractKeyFromPemObject(PrivateKeyUtils.kt:76)
at org.jetbrains.zip.signer.signer.PrivateKeyUtils.loadKeyPair(PrivateKeyUtils.kt:62)
at org.jetbrains.zip.signer.signer.PrivateKeyUtils.loadKeyPair(PrivateKeyUtils.kt:48)
at org.jetbrains.zip.signer.signer.SignerInfoLoader.loadSignerInfoFromText(SignerInfoLoader.kt:30)
at org.jetbrains.zip.signer.ZipSigningTool.sign(ZipSigningTool.kt:58)
at org.jetbrains.zip.signer.ZipSigningTool.main(ZipSigningTool.kt:29)
Caused by: java.lang.IllegalArgumentException: failed to construct sequence from byte[]: Extra data detected in stream
at org.bouncycastle.asn1.ASN1Sequence.getInstance(Unknown Source)
at org.bouncycastle.asn1.pkcs.PrivateKeyInfo.getInstance(Unknown Source)
... 7 more

I tried all kind of formatting. Removing the ---Begin ...---, with new lines, without new lines, etc. Not sure what im doing wrong.

0
2 comments

Sorry for the late reply. Is this still the case?

0

Yep. I'm currently using the marketplace-zip-signer-cli directly which works fine, but via Gradle would be obviously nicer. 

0

Please sign in to leave a comment.