Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

unknown object in getInstance: org.bouncycastle.asn1.DERApplicationSpecific #4

Open
cgruber0 opened this issue Feb 23, 2019 · 0 comments

Comments

@cgruber0
Copy link

Hi,

I use this library to read encrypted Emails. All emails are read without problems, except those from one client.

Said emails throw this exception:

net.markenwerk.utils.mail.smime.SmimeException: Malformed content. at net.markenwerk.utils.mail.smime.SmimeUtil.handledException(SmimeUtil.java:615) ~[utils-mail-smime-1.0.8.jar:na] at net.markenwerk.utils.mail.smime.SmimeUtil.decrypt(SmimeUtil.java:235) ~[utils-mail-smime-1.0.8.jar:na] at helpers.email.EmailFetcher.decryptMessageIfNecessary(EmailFetcher.java:293) [classes/:na] at helpers.email.EmailFetcher.processMessage(EmailFetcher.java:194) [classes/:na] at helpers.Converter.convertToPDF(Converter.java:59) [classes/:na] Caused by: org.bouncycastle.cms.CMSException: Malformed content. at org.bouncycastle.cms.CMSUtils.readContentInfo(Unknown Source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0] at org.bouncycastle.cms.CMSUtils.readContentInfo(Unknown Source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0] at org.bouncycastle.cms.CMSEnvelopedData.<init>(Unknown Source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0] at org.bouncycastle.mail.smime.SMIMEEnveloped.<init>(Unknown Source) ~[bcmail-jdk15on-1.56.jar:1.56.0.0] at net.markenwerk.utils.mail.smime.SmimeUtil.decrypt(SmimeUtil.java:225) ~[utils-mail-smime-1.0.8.jar:na] Caused by: java.lang.IllegalArgumentException: unknown object in getInstance: org.bouncycastle.asn1.DERApplicationSpecific at org.bouncycastle.asn1.ASN1Sequence.getInstance(Unknown Source) ~[bcprov-jdk15on-1.56.jar:1.56.0] at org.bouncycastle.asn1.cms.ContentInfo.getInstance(Unknown Source) ~[bcprov-jdk15on-1.56.jar:1.56.0] at org.bouncycastle.cms.CMSUtils.readContentInfo(Unknown Source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0] at org.bouncycastle.cms.CMSUtils.readContentInfo(Unknown Source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0] at org.bouncycastle.cms.CMSEnvelopedData.<init>(Unknown Source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0]

The emails are encrypted using RSA (2048) / AES (256). The email is decrypted in MS Outlook without problems.

I know the BouncyCastle library actually throws the exception (I already filed an issue there https://github.com/bcgit/bc-java/issues/462), but maybe somebody here can help too since I don't get any helpful answer there?

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant