diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java index c90b6b92..8e56dcdb 100644 --- a/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java @@ -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"); } diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagConstants.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagConstants.java index 96773ca4..3ca76778 100644 --- a/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagConstants.java +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagConstants.java @@ -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( diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java index b99a5e6f..8b3120a7 100644 --- a/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java @@ -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; diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/Commander.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/Commander.java index 0dec9a9f..b80c428d 100644 --- a/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/Commander.java +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/Commander.java @@ -45,9 +45,9 @@ public class Commander { @Parameter(names = {"-l", "--rimel "}, 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 {