From c4efec1daeb50b30d363bb9fb83aec5435dbf2ad Mon Sep 17 00:00:00 2001 From: tknall Date: Mon, 27 Apr 2009 08:16:42 +0000 Subject: New signature layout for new MOCCA bku integrated (etsi-moc-1.1). New architecture implemented that allows different signature layouts for single types of BKUs. git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@337 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../wag/egov/egiz/sig/sigid/DetachedMOCIdFormatter.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedMOCIdFormatter.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedMOCIdFormatter.java index ae46225..8b9b606 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedMOCIdFormatter.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedMOCIdFormatter.java @@ -16,17 +16,21 @@ import at.knowcenter.wag.egov.egiz.exceptions.SettingsException; */ public class DetachedMOCIdFormatter implements IdFormatter { - public static final String SIG_ID_PREFIX = "etsi-moc-1.0"; - /** * Key value in property file */ - public static final String SIG_ID_PROPERTY_KEY = "default.moc.algorithm.id"; + private static final String SIG_ID_PROPERTY_KEY = "default.moc.algorithm.id"; /** * The log. */ private static Log log = LogFactory.getLog(DetachedIdFormatter.class); + + private String algorithmId; + + public DetachedMOCIdFormatter(String algorithmId) { + this.algorithmId = algorithmId; + } /** * @see at.knowcenter.wag.egov.egiz.sig.sigid.IdFormatter#formatIds(java.lang.String[]) @@ -39,7 +43,7 @@ public class DetachedMOCIdFormatter implements IdFormatter { } catch (SettingsException e) { log.error(e.getMessage(), e); } - prefix = StringUtils.defaultIfEmpty(prefix, SIG_ID_PREFIX); + prefix = StringUtils.defaultIfEmpty(this.algorithmId, prefix); StringBuffer formattedIds = new StringBuffer(prefix).append("@").append(ids[0]); return formattedIds.toString(); -- cgit v1.2.3