private List<TSDMetas> extractMetas(InputStream stream) throws SAXException {
        List<TSDMetas> tsdMetasList = new ArrayList<>();

        try {
            CMSTimeStampedData cmsTimeStampedData = new CMSTimeStampedData(stream);

            TimeStampToken[] tokens = cmsTimeStampedData.getTimeStampTokens();

            for (TimeStampToken token : tokens) {
                TSDMetas tsdMetas = new TSDMetas(true, token.getTimeStampInfo().getGenTime(),
                        token.getTimeStampInfo().getPolicy().getId(),
                        token.getTimeStampInfo().getSerialNumber(),
                        token.getTimeStampInfo().getTsa(),
                        token.getTimeStampInfo().getHashAlgorithm().getAlgorithm().getId());

                tsdMetasList.add(tsdMetas);
            }

        } catch (SecurityException e) {
            throw e;
        } catch (Exception ex) {
            WriteLimitReachedException.throwIfWriteLimitReached(ex);
            LOG.error("Error in TSDParser.buildMetas {}", ex.getMessage());
            tsdMetasList.clear();
        }

        return tsdMetasList;
    }
Tika parser for Time Stamped Data Envelope (application/timestamped-data)
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-crypto-module/src/main/java/org/apache/tika/parser/crypto/TSDParser.java