From 54b6807c2275544334446bc123932a41f7b13a2f Mon Sep 17 00:00:00 2001 From: tkellner Date: Mon, 2 Apr 2012 16:38:43 +0000 Subject: Enhance toString output for ACOS Card git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1035 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java b/smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java index 6d9effb6..fed044ab 100644 --- a/smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java +++ b/smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java @@ -123,13 +123,18 @@ PINMgmtSignatureCard { /** * The version of the card's digital signature application. */ - protected int appVersion = -1; + protected int appVersion = -1; + + /** + * The detected type of ACOS card. + */ + protected String cardType; @Override public void init(Card card, CardTerminal cardTerminal) { super.init(card, cardTerminal); - log.info("A-Sign premium ACOS card found"); + log.info("ACOS card found"); // determine application version try { @@ -195,15 +200,19 @@ PINMgmtSignatureCard { if (countryID == null) { log.debug("No Country found! - default to ACOS Austria."); + cardType = "A-Sign premium"; _infoboxHandler = new ACOSATCard(this); } else if (countryID.equalsIgnoreCase("LI")) { log.debug("Identified lisign card."); + cardType = "lisign"; _infoboxHandler = new ACOSLIESignCard(this); } else { log.debug("No lisign card - default to ACOS Austria."); + cardType = "A-Sign premium"; _infoboxHandler = new ACOSATCard(this); } + log.info("Identified {} card", cardType); } catch (SignatureCardException e) { log.warn("Cannot determine card type by certificate. Using default.", e); _infoboxHandler = new ACOSATCard(this); @@ -444,7 +453,10 @@ PINMgmtSignatureCard { @Override public String toString() { - return "a-sign premium (version " + getAppVersion() + ")"; + String ret = "ACOS card: " + cardType; + if (getAppVersion() > 0) + ret += " (application version " + getAppVersion() + ")"; + return ret; } //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3