use of org.bouncycastle.tsp.cms.CMSTimeStampedData in project tika by apache.
the class TSDParser method extractMetas.
private List<TSDMetas> extractMetas(InputStream stream) {
List<TSDMetas> tsdMetasList = new ArrayList<>();
try {
CMSTimeStampedData cmsTimeStampedData = new CMSTimeStampedData(stream);
TimeStampToken[] tokens = cmsTimeStampedData.getTimeStampTokens();
for (int i = 0; i < tokens.length; i++) {
TSDMetas tsdMetas = new TSDMetas(true, tokens[i].getTimeStampInfo().getGenTime(), tokens[i].getTimeStampInfo().getPolicy().getId(), tokens[i].getTimeStampInfo().getSerialNumber(), tokens[i].getTimeStampInfo().getTsa(), tokens[i].getTimeStampInfo().getHashAlgorithm().getAlgorithm().getId());
tsdMetasList.add(tsdMetas);
}
} catch (Exception ex) {
LOG.error("Error in TSDParser.buildMetas {}", ex.getMessage());
tsdMetasList.clear();
}
return tsdMetasList;
}
Aggregations