Updated references of RFC3161 to RFC3852

This commit is contained in:
chubtub 2022-11-21 14:04:11 -05:00
parent 075d68664f
commit b5681411c0
4 changed files with 13 additions and 15 deletions

View File

@ -3,8 +3,6 @@ package hirs.swid;
import hirs.swid.utils.Commander;
import com.beust.jcommander.JCommander;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
@ -81,8 +79,8 @@ public class Main {
} else {
gateway.setRimEventLog(rimEventLog);
}
if (commander.isRfc3161()) {
gateway.setTimestampFormat("RFC3161");
if (commander.isRfc3852()) {
gateway.setTimestampFormat("RFC3852");
} else if (commander.isRfc3339()) {
gateway.setTimestampFormat("RFC3339");
}

View File

@ -75,12 +75,12 @@ public class SwidTagConstants {
public static final String NIST_NS = "http://csrc.nist.gov/ns/swid/2015-extensions/1.0";
public static final String TCG_NS = "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model";
public static final String RFC3161_NS = "https://www.ietf.org/rfc/rfc3161.txt";
public static final String RFC3852_NS = "https://www.ietf.org/rfc/rfc3852.txt";
public static final String RFC3339_NS = "https://www.ietf.org/rfc/rfc3339.txt";
public static final String N8060_PFX = "n8060";
public static final String RIM_PFX = "rim";
public static final String RFC3161_PFX = "rcf3161";
public static final String RFC3852_PFX = "rcf3852";
public static final String RFC3339_PFX = "rcf3339";
public static final QName _SHA256_HASH = new QName(

View File

@ -640,10 +640,10 @@ public class SwidTagGateway {
private XMLObject createXmlTimestamp(Document doc, XMLSignatureFactory sigFactory) {
Element timeStampElement = doc.createElement("TimeStamp");
switch (timestampFormat) {
case "RFC3161":
case "RFC3852":
timeStampElement.setAttributeNS("http://www.w3.org/2000/xmlns/",
"xmlns:" + SwidTagConstants.RFC3161_PFX,
SwidTagConstants.RFC3161_NS);
"xmlns:" + SwidTagConstants.RFC3852_PFX,
SwidTagConstants.RFC3852_NS);
timeStampElement.setAttribute(SwidTagConstants.DATETIME,
"Base64 blob here");
break;

View File

@ -45,9 +45,9 @@ public class Commander {
@Parameter(names = {"-l", "--rimel <path>"}, order = 9,
description = "The TCG eventlog file to use as a support RIM.")
private String rimEventLog = "";
@Parameter(names = {"--rfc3161"}, order = 10,
description = "Add a timestamp to the signature that is compliant with RFC3161.")
private boolean rfc3161 = false;
@Parameter(names = {"--rfc3852"}, order = 10,
description = "Add a timestamp to the signature that is compliant with RFC3852.")
private boolean rfc3852 = false;
@Parameter(names = {"--rfc3339"}, order = 11,
description = "Add a timestamp to the signature that is compliant with RFC3339.")
private boolean rfc3339 = false;
@ -88,7 +88,7 @@ public class Commander {
public String getRimEventLog() { return rimEventLog; }
public boolean isRfc3161() { return rfc3161; }
public boolean isRfc3852() { return rfc3852; }
public boolean isRfc3339() { return rfc3339; }
@ -133,8 +133,8 @@ public class Commander {
sb.append("Signing credential: (none given)" + System.lineSeparator());
}
sb.append("Event log support RIM: " + this.getRimEventLog() + System.lineSeparator());
if (isRfc3161()) {
sb.append("Timestamp format: RFC3161");
if (isRfc3852()) {
sb.append("Timestamp format: RFC3852");
} else if (isRfc3339()) {
sb.append("Timestamp format: RFC3339");
} else {