mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-18 20:47:58 +00:00
Modify rimtool to properly namespace timestamp elements
This commit is contained in:
parent
78d85bddfd
commit
5d10dc4b1c
@ -718,11 +718,13 @@ public class SwidTagGateway {
|
|||||||
try {
|
try {
|
||||||
byte[] counterSignature = Base64.getEncoder().encode(
|
byte[] counterSignature = Base64.getEncoder().encode(
|
||||||
Files.readAllBytes(Paths.get(timestampArgument)));
|
Files.readAllBytes(Paths.get(timestampArgument)));
|
||||||
timeStampElement = doc.createElementNS(SwidTagConstants.RFC3852_NS, "TimeStamp");
|
timeStampElement = doc.createElementNS(SwidTagConstants.RFC3852_NS,
|
||||||
|
SwidTagConstants.RFC3852_PFX + ":TimeStamp");
|
||||||
timeStampElement.setAttributeNS("http://www.w3.org/2000/xmlns/",
|
timeStampElement.setAttributeNS("http://www.w3.org/2000/xmlns/",
|
||||||
"xmlns:" + SwidTagConstants.RFC3852_PFX,
|
"xmlns:" + SwidTagConstants.RFC3852_PFX,
|
||||||
SwidTagConstants.RFC3852_NS);
|
SwidTagConstants.RFC3852_NS);
|
||||||
timeStampElement.setAttribute(SwidTagConstants.DATETIME,
|
timeStampElement.setAttributeNS(SwidTagConstants.RFC3852_NS,
|
||||||
|
SwidTagConstants.RFC3852_PFX + ":" + SwidTagConstants.DATETIME,
|
||||||
new String(counterSignature));
|
new String(counterSignature));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -730,15 +732,17 @@ public class SwidTagGateway {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "RFC3339":
|
case "RFC3339":
|
||||||
timeStampElement = doc.createElementNS(SwidTagConstants.RFC3339_NS, "TimeStamp");
|
timeStampElement = doc.createElementNS(SwidTagConstants.RFC3339_NS,
|
||||||
|
SwidTagConstants.RFC3339_PFX + ":TimeStamp");
|
||||||
timeStampElement.setAttributeNS("http://www.w3.org/2000/xmlns/",
|
timeStampElement.setAttributeNS("http://www.w3.org/2000/xmlns/",
|
||||||
"xmlns:" + SwidTagConstants.RFC3339_PFX,
|
"xmlns:" + SwidTagConstants.RFC3339_PFX, SwidTagConstants.RFC3339_NS);
|
||||||
SwidTagConstants.RFC3339_NS);
|
|
||||||
if (timestampArgument.isEmpty()) {
|
if (timestampArgument.isEmpty()) {
|
||||||
timeStampElement.setAttribute(SwidTagConstants.DATETIME,
|
timeStampElement.setAttributeNS(SwidTagConstants.RFC3339_NS,
|
||||||
|
SwidTagConstants.RFC3339_PFX + ":" + SwidTagConstants.DATETIME,
|
||||||
LocalDateTime.now().toString());
|
LocalDateTime.now().toString());
|
||||||
} else {
|
} else {
|
||||||
timeStampElement.setAttribute(SwidTagConstants.DATETIME,
|
timeStampElement.setAttributeNS(SwidTagConstants.RFC3339_NS,
|
||||||
|
SwidTagConstants.RFC3339_PFX + ":" + SwidTagConstants.DATETIME,
|
||||||
timestampArgument);
|
timestampArgument);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user