Search in sources :

Example 1 with IndividualDataObjsTimeStampData

use of xades4j.properties.data.IndividualDataObjsTimeStampData in project xades4j by luisgoncalves.

the class DataGenIndivDataObjsTimeStamp method createPropDataObj.

@Override
protected BaseXAdESTimeStampData createPropDataObj(IndividualDataObjsTimeStampProperty prop, Algorithm c14n, TimeStampTokenRes tsTknRes, PropertiesDataGenerationContext ctx) {
    Collection<DataObjectDesc> targetDataObjs = prop.getTargetDataObjects();
    Map<DataObjectDesc, Reference> refsMaps = ctx.getReferencesMappings();
    List<String> includes = new ArrayList<String>(targetDataObjs.size());
    for (DataObjectDesc dataObj : targetDataObjs) {
        Reference r = refsMaps.get(dataObj);
        includes.add('#' + r.getId());
    }
    prop.setTime(tsTknRes.timeStampTime);
    return new IndividualDataObjsTimeStampData(c14n, includes, tsTknRes.encodedTimeStampToken);
}
Also used : Reference(org.apache.xml.security.signature.Reference) ArrayList(java.util.ArrayList) DataObjectDesc(xades4j.properties.DataObjectDesc) IndividualDataObjsTimeStampData(xades4j.properties.data.IndividualDataObjsTimeStampData)

Aggregations

ArrayList (java.util.ArrayList)1 Reference (org.apache.xml.security.signature.Reference)1 DataObjectDesc (xades4j.properties.DataObjectDesc)1 IndividualDataObjsTimeStampData (xades4j.properties.data.IndividualDataObjsTimeStampData)1