You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating TrustAnchor signatures the CLI currently does not support private keys in PKCS#1 format.
Doing this results in:
org.bouncycastle.openssl.PEMException: problem parsing PRIVATE KEY: java.lang.IllegalArgumentException: unknown object in getInstance: org.bouncycastle.asn1.ASN1Integer
at org.bouncycastle.openssl.PEMParser$PrivateKeyParser.parseObject(Unknown Source)
at org.bouncycastle.openssl.PEMParser.readObject(Unknown Source)
at eu.europa.ec.dgc.cli.utils.CliUtils.readKeyFromFile(CliUtils.java:50)
at eu.europa.ec.dgc.cli.trustanchor.Sign.call(Sign.java:83)
at eu.europa.ec.dgc.cli.trustanchor.Sign.call(Sign.java:47)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at eu.europa.ec.dgc.cli.Main.main(Main.java:28)
Caused by: java.lang.IllegalArgumentException: unknown object in getInstance: org.bouncycastle.asn1.ASN1Integer
at org.bouncycastle.asn1.ASN1Sequence.getInstance(Unknown Source)
at org.bouncycastle.asn1.x509.AlgorithmIdentifier.getInstance(Unknown Source)
at org.bouncycastle.asn1.pkcs.PrivateKeyInfo.<init>(Unknown Source)
at org.bouncycastle.asn1.pkcs.PrivateKeyInfo.getInstance(Unknown Source)
... 13 more
Expected behaviour
dgc ta sign -c cert_ta.pem -k key_ta-unenc.pem -i cert.pem
with a PKCS#1 PrivateKey should succesfully sign a certificate with TrustAnchor.
The problem is in eu.europa.ec.dgc.cli.utils.CliUtils#readKeyFromFile method. This method only tries to parse content of pem file into PrivateKeyInfo. This should be reworked in order to support other Private Key format.
The text was updated successfully, but these errors were encountered:
Describe the bug
When creating TrustAnchor signatures the CLI currently does not support private keys in PKCS#1 format.
Doing this results in:
Expected behaviour
with a PKCS#1 PrivateKey should succesfully sign a certificate with TrustAnchor.
Steps to reproduce the issue
Workaround
See #4 for a workaround
Possible Fix
The problem is in eu.europa.ec.dgc.cli.utils.CliUtils#readKeyFromFile method. This method only tries to parse content of pem file into PrivateKeyInfo. This should be reworked in order to support other Private Key format.
The text was updated successfully, but these errors were encountered: