[jira] [Commented] (TIKA-2857) Cannot parse PKCS7 files

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (TIKA-2857) Cannot parse PKCS7 files

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/TIKA-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16821033#comment-16821033 ]

Chinh Nguyen commented on TIKA-2857:
------------------------------------

Note I have to force tika to use PKCS7 parser with digest file via xml config because it thinks it's an octet-stream (see TIKA-2856)

Similarly, when I use an xml config to do PKCS7 parsing on attachment from TIKA-1997, it will also generate errors
{quote}java  -jar tika-app-1.20.jar --config=tika.xml test.xml.p7m
Exception in thread "main" org.apache.tika.exception.TikaException: TIKA\-198: Illegal IOException from org.apache.tika.parser.ParserDecorator$1@47c62251
        at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:286)
        at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280){quote}

> Cannot parse PKCS7 files
> ------------------------
>
>                 Key: TIKA-2857
>                 URL: https://issues.apache.org/jira/browse/TIKA-2857
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.20
>            Reporter: Chinh Nguyen
>            Priority: Major
>
> I cannot get tika to parse any PKCS7 files. All seem to generate Java exceptions:
> * Create a "cert-only" file: {{openssl crl2pkcs7 -nocrl -certfile /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority.crt -out cert.p7 -outform der}}
> * Create a signed file: {{echo "hello world" | openssl cms -sign -inkey key.pem -signer cert.pem -md sha256 -outform der -nodetach -out sign.p7}}
> * Create a digest file: {{echo "hello world" | openssl cms -digest_create -md sha256 -outform der -out digest.p7}}
> Try to parse these files:
> {quote}java  -jar tika-app-1.20.jar cert.p7
> Exception in thread "main" org.apache.tika.exception.TikaException: cannot parse detached pkcs7 signature (no signed data to parse)
> at org.apache.tika.parser.crypto.Pkcs7Parser.parse(Pkcs7Parser.java:81)
> at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
> at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
> at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143)
> at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:209)
> at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:496)
> at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:149){quote}
> {quote}java  -jar tika-app-1.20.jar sign.p7
> Exception in thread "main" org.apache.tika.exception.TikaException: TIKA\-198: Illegal IOException from org.apache.tika.parser.crypto.Pkcs7Parser@76a4d6c
> at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:286)
> at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
> at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143){quote}
> {quote}java  -jar tika-app-1.20.jar --config=tika.xml digest.p7
> Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.ParserDecorator$1@5dfcfece
> at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:282)
> at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
> at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143)
> at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:209)
> at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:496)
> at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:149)
> Caused by: java.lang.ClassCastException: org.bouncycastle.asn1.DERSequenceParser cannot be cast to org.bouncycastle.asn1.ASN1SetParser
> at org.bouncycastle.asn1.cms.SignedDataParser.getDigestAlgorithms(Unknown Source){quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)