Class CmsClassifier

java.lang.Object
org.apache.tika.parser.crypto.CmsClassifier

public final class CmsClassifier extends Object
Classifies a CMS/PKCS7 stream by its ContentInfo content-type OID (and, for signedData, its sub-shape) into a refined Tika MediaType. Shared by Pkcs7Parser (parse-time labelling) and the optional detector. Reads via the spooled file and returns null if the stream is not recognizable CMS, so a caller can fall back to the coarse type.
  • Method Details

    • classify

      public static MediaType classify(TikaInputStream tis) throws IOException
      Returns:
      the refined media type, or null if the stream is not recognizable CMS.
      Throws:
      IOException - on a genuine spool/read failure — distinct from "not CMS" (which returns null), so a real I/O error is not silently masked as a non-crypto stream.