use of com.github.zhenwei.pkix.util.asn1.tsp.TimeStampReq in project gdmatrix by gdmatrix.
the class CMSUtils method createTimeStamp.
public static ContentInfo createTimeStamp(String serviceURI, byte[] message) throws Exception {
String nonce = String.valueOf((int) (Math.random() * 1000000));
// es crea la peticio a la TSA
TimeStampReq timeStampRequest = createTimeStampRequest(// message
message, // nonce
nonce, // requireCert
true, // extensions
null, // digestAlgorithm identifier
"1.3.14.3.2.26", // timestampPolicy
"0.4.0.2023.1.1");
// s'envia la peticio creada
TimeStampResp timeStampResponse = sendTimestampRequest(timeStampRequest, serviceURI);
ContentInfo contentInfo = timeStampResponse.getTimeStampToken();
return contentInfo;
}
Aggregations