From a722ad1f7e8506c58f594ac84dfdedac88a556d4 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 30 Jul 2020 11:02:10 +0200 Subject: update MOA-Sig verification API to set signature-verification timestamp --- .../eaaf/core/impl/idp/auth/data/IdentityLink.java | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'eaaf_core/src') diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/data/IdentityLink.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/data/IdentityLink.java index ee1037a1..8327b544 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/data/IdentityLink.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/data/IdentityLink.java @@ -23,15 +23,20 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.Serializable; import java.security.PublicKey; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; import javax.xml.transform.TransformerException; -import org.w3c.dom.Element; - import at.gv.egiz.eaaf.core.api.idp.auth.data.IIdentityLink; import at.gv.egiz.eaaf.core.impl.utils.DomUtils; import at.gv.egiz.eaaf.core.impl.utils.XPathUtils; +import org.w3c.dom.Element; + +import lombok.extern.slf4j.Slf4j; + /** * Data contained in an identity link issued by BMI, relevant to the MOA ID * component.
@@ -41,10 +46,13 @@ import at.gv.egiz.eaaf.core.impl.utils.XPathUtils; * @author Paul Ivancsics * @version $Id$ */ +@Slf4j public class IdentityLink implements Serializable, IIdentityLink { private static final long serialVersionUID = 1L; + public static final String PATTERN_ISSUE_INSTANT = "yyyy-MM-dd'T'HH:mm:ssXXX"; + /** * "identificationValue" is the translation of * "Stammzahl". @@ -372,6 +380,23 @@ public class IdentityLink implements Serializable, IIdentityLink { return issueInstant; } + @Override + public Date getIssueInstantDate() { + final SimpleDateFormat f = new SimpleDateFormat(PATTERN_ISSUE_INSTANT); + try { + if (issueInstant != null) { + return f.parse(issueInstant); + + } + + } catch (final ParseException e) { + log.error("Can NOT parse Date from String: {}", issueInstant, null, e); + + } + + return null; + } + /* * (non-Javadoc) * -- cgit v1.2.3