mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-27 16:28:57 +00:00
Declare namespace for TimeStamp element
This commit is contained in:
parent
f875a2c981
commit
e7889ca5fb
@ -712,12 +712,13 @@ public class SwidTagGateway {
|
|||||||
* @return an XMLObject containing the timestamp element
|
* @return an XMLObject containing the timestamp element
|
||||||
*/
|
*/
|
||||||
private XMLObject createXmlTimestamp(Document doc, XMLSignatureFactory sigFactory) {
|
private XMLObject createXmlTimestamp(Document doc, XMLSignatureFactory sigFactory) {
|
||||||
Element timeStampElement = doc.createElement("TimeStamp");
|
Element timeStampElement = null;
|
||||||
switch (timestampFormat.toUpperCase()) {
|
switch (timestampFormat.toUpperCase()) {
|
||||||
case "RFC3852":
|
case "RFC3852":
|
||||||
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.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);
|
||||||
@ -729,6 +730,7 @@ public class SwidTagGateway {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "RFC3339":
|
case "RFC3339":
|
||||||
|
timeStampElement = doc.createElementNS(SwidTagConstants.RFC3339_NS, "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);
|
||||||
|
Loading…
Reference in New Issue
Block a user