package at.gv.egovernment.moa.id.configuration.data; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModeType; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.ConnectionParameterClientAuthType; import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSigners; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSignersX509SubjectNameItem; import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineMandates; import at.gv.egovernment.moa.id.commons.db.dao.config.Organization; import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; import at.gv.egovernment.moa.id.commons.db.dao.config.Protocols; import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; import at.gv.egovernment.moa.id.commons.db.dao.config.SSO; import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; import at.gv.egovernment.moa.id.commons.db.dao.config.SecurityLayer; import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType; import at.gv.egovernment.moa.id.commons.db.dao.config.TrustAnchor; import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlock; import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyIdentityLink; import at.gv.egovernment.moa.id.configuration.Constants; import at.gv.egovernment.moa.id.configuration.data.pvp2.ContactForm; public class GeneralMOAIDConfig { public static final long DEFAULTTIMEOUTASSERTION = 120; //sec public static final long DEFAULTTIMEOUTMOASESSIONCREATED = 1200; //sec public static final long DEFAULTTIMEOUTMOASESSIONUPDATED = 2700; //sec public static final String LINE_DELIMITER = ";"; private String szrgwURL = null; private String alternativeSourceID = null; private String certStoreDirectory = null; private boolean trustmanagerrevocationcheck = false; private String timeoutAssertion = String.valueOf(DEFAULTTIMEOUTASSERTION); private String timeoutMOASessionCreated = String.valueOf(DEFAULTTIMEOUTMOASESSIONCREATED); private String timeoutMOASessionUpdated = String.valueOf(DEFAULTTIMEOUTMOASESSIONUPDATED); private String moaspssURL = null; private String moaspssAuthTrustProfile = null; private String moaspssAuthTransformations = ""; private List authTransformList = null; private String moaspssIdlTrustProfile = null; private String mandateURL = null; private boolean legacy_saml1 = false; private boolean legacy_pvp2 = false; private String pvp2PublicUrlPrefix = null; private String pvp2IssuerName = null; private String pvp2OrgName = null; private String pvp2OrgDisplayName = null; private String pvp2OrgURL = null; private ContactForm pvp2Contact = null; private List fileUpload = null; private List fileUploadContentType; private List fileUploadFileName; private Map secLayerTransformation = null; private String ssoTarget = null; private String ssoFriendlyName = null; private String ssoPublicUrl = null; private String ssoSpecialText = null; private String ssoIdentificationNumber = null; private String defaultchainigmode = null; private static Map chainigmodelist; private String trustedCACerts = null; private String defaultBKUOnline = ""; private String defaultBKULocal = "https://127.0.0.1:3496/https-security-layer-request"; private String defaultBKUHandy = "https://www.handy-signatur.at/mobile/https-security-layer-request/default.aspx"; private String SLRequestTemplateOnline = ""; private String SLRequestTemplateLocal = ""; private String SLRequestTemplateHandy = ""; public GeneralMOAIDConfig() { chainigmodelist = new HashMap(); ChainingModeType[] values = ChainingModeType.values(); for (int i=0; i list = authblock.getVerifyTransformsInfoProfileID(); for (String el : list) moaspssAuthTransformations += el + LINE_DELIMITER + "\n"; } VerifyIdentityLink idl = moaspss.getVerifyIdentityLink(); if (idl != null) { moaspssIdlTrustProfile = idl.getTrustProfileID(); } } OnlineMandates mandates = auth.getOnlineMandates(); if (mandates != null) { ConnectionParameterClientAuthType con = mandates.getConnectionParameter(); if (con != null) { mandateURL = con.getURL(); } } Protocols protocols = auth.getProtocols(); if (protocols != null) { LegacyAllowed legacy = protocols.getLegacyAllowed(); if (legacy != null) { List list = legacy.getProtocolName(); if (list.contains(Constants.MOA_CONFIG_PROTOCOL_SAML1)) legacy_saml1 = true; if (list.contains(Constants.MOA_CONFIG_PROTOCOL_PVP2)) legacy_pvp2 = true; } PVP2 pvp2 = protocols.getPVP2(); if (pvp2 != null) { pvp2PublicUrlPrefix = pvp2.getPublicURLPrefix(); pvp2IssuerName = pvp2.getIssuerName(); List con = pvp2.getContact(); //TODO: change to support more contacts if (con != null && con.size() > 0) { pvp2Contact = new ContactForm(con.get(0)); } Organization org = pvp2.getOrganization(); if (org != null) { pvp2OrgDisplayName = org.getDisplayName(); pvp2OrgName = org.getName(); pvp2OrgURL = org.getURL(); } } } SecurityLayer seclayer = auth.getSecurityLayer(); if (seclayer != null) { List list = seclayer.getTransformsInfo(); fileUploadFileName = new ArrayList(); for (TransformsInfoType el : list) { fileUploadFileName.add(el.getFilename()); } } SSO sso = auth.getSSO(); if (sso != null) { ssoFriendlyName = sso.getFriendlyName(); IdentificationNumber idl = sso.getIdentificationNumber(); if (idl != null) ssoIdentificationNumber = idl.getValue(); ssoPublicUrl = sso.getPublicURL(); ssoSpecialText = sso.getSpecialText(); ssoTarget = sso.getTarget(); } } ChainingModes modes = config.getChainingModes(); if (modes != null) { ChainingModeType defaultmode = modes.getSystemDefaultMode(); if (defaultmode != null) { defaultchainigmode = defaultmode.value(); } List trustanchor = modes.getTrustAnchor(); if (trustanchor != null) { //TODO: set addional trust anchors!!!! } } trustedCACerts = config.getTrustedCACertificates(); DefaultBKUs defaultbkus = config.getDefaultBKUs(); if (defaultbkus != null) { defaultBKUHandy = defaultbkus.getHandyBKU(); defaultBKULocal = defaultbkus.getLocalBKU(); defaultBKUOnline = defaultbkus.getOnlineBKU(); } SLRequestTemplates slreq = config.getSLRequestTemplates(); if (slreq != null) { SLRequestTemplateHandy = slreq.getHandyBKU(); SLRequestTemplateLocal = slreq.getLocalBKU(); SLRequestTemplateOnline = slreq.getOnlineBKU(); } } } /** * @return the szrgwURL */ public String getSzrgwURL() { return szrgwURL; } /** * @param szrgwURL the szrgwURL to set */ public void setSzrgwURL(String szrgwURL) { this.szrgwURL = szrgwURL; } /** * @return the alternativeSourceID */ public String getAlternativeSourceID() { return alternativeSourceID; } /** * @param alternativeSourceID the alternativeSourceID to set */ public void setAlternativeSourceID(String alternativeSourceID) { this.alternativeSourceID = alternativeSourceID; } /** * @return the certStoreDirectory */ public String getCertStoreDirectory() { return certStoreDirectory; } /** * @param certStoreDirectory the certStoreDirectory to set */ public void setCertStoreDirectory(String certStoreDirectory) { this.certStoreDirectory = certStoreDirectory; } /** * @return the timeoutAssertion */ public String getTimeoutAssertion() { return timeoutAssertion; } /** * @param timeoutAssertion the timeoutAssertion to set */ public void setTimeoutAssertion(String timeoutAssertion) { this.timeoutAssertion = timeoutAssertion; } /** * @return the timeoutMOASessionCreated */ public String getTimeoutMOASessionCreated() { return timeoutMOASessionCreated; } /** * @param timeoutMOASessionCreated the timeoutMOASessionCreated to set */ public void setTimeoutMOASessionCreated(String timeoutMOASessionCreated) { this.timeoutMOASessionCreated = timeoutMOASessionCreated; } /** * @return the timeoutMOASessionUpdated */ public String getTimeoutMOASessionUpdated() { return timeoutMOASessionUpdated; } /** * @param timeoutMOASessionUpdated the timeoutMOASessionUpdated to set */ public void setTimeoutMOASessionUpdated(String timeoutMOASessionUpdated) { this.timeoutMOASessionUpdated = timeoutMOASessionUpdated; } /** * @return the moaspssURL */ public String getMoaspssURL() { return moaspssURL; } /** * @param moaspssURL the moaspssURL to set */ public void setMoaspssURL(String moaspssURL) { this.moaspssURL = moaspssURL; } /** * @return the moaspssAuthTrustProfile */ public String getMoaspssAuthTrustProfile() { return moaspssAuthTrustProfile; } /** * @param moaspssAuthTrustProfile the moaspssAuthTrustProfile to set */ public void setMoaspssAuthTrustProfile(String moaspssAuthTrustProfile) { this.moaspssAuthTrustProfile = moaspssAuthTrustProfile; } /** * @return the moaspssAuthTransformations */ public String getMoaspssAuthTransformations() { return moaspssAuthTransformations; } /** * @param moaspssAuthTransformations the moaspssAuthTransformations to set */ public void setMoaspssAuthTransformations(String moaspssAuthTransformations) { this.moaspssAuthTransformations = moaspssAuthTransformations; } /** * @return the moaspssIdlTrustProfile */ public String getMoaspssIdlTrustProfile() { return moaspssIdlTrustProfile; } /** * @param moaspssIdlTrustProfile the moaspssIdlTrustProfile to set */ public void setMoaspssIdlTrustProfile(String moaspssIdlTrustProfile) { this.moaspssIdlTrustProfile = moaspssIdlTrustProfile; } /** * @return the mandateURL */ public String getMandateURL() { return mandateURL; } /** * @param mandateURL the mandateURL to set */ public void setMandateURL(String mandateURL) { this.mandateURL = mandateURL; } /** * @return the legacy_saml1 */ public boolean isLegacy_saml1() { return legacy_saml1; } /** * @param legacy_saml1 the legacy_saml1 to set */ public void setLegacy_saml1(boolean legacy_saml1) { this.legacy_saml1 = legacy_saml1; } /** * @return the legacy_pvp2 */ public boolean isLegacy_pvp2() { return legacy_pvp2; } /** * @param legacy_pvp2 the legacy_pvp2 to set */ public void setLegacy_pvp2(boolean legacy_pvp2) { this.legacy_pvp2 = legacy_pvp2; } /** * @return the pvp2PublicUrlPrefix */ public String getPvp2PublicUrlPrefix() { return pvp2PublicUrlPrefix; } /** * @param pvp2PublicUrlPrefix the pvp2PublicUrlPrefix to set */ public void setPvp2PublicUrlPrefix(String pvp2PublicUrlPrefix) { this.pvp2PublicUrlPrefix = pvp2PublicUrlPrefix; } /** * @return the pvp2IssuerName */ public String getPvp2IssuerName() { return pvp2IssuerName; } /** * @param pvp2IssuerName the pvp2IssuerName to set */ public void setPvp2IssuerName(String pvp2IssuerName) { this.pvp2IssuerName = pvp2IssuerName; } /** * @return the pvp2OrgName */ public String getPvp2OrgName() { return pvp2OrgName; } /** * @param pvp2OrgName the pvp2OrgName to set */ public void setPvp2OrgName(String pvp2OrgName) { this.pvp2OrgName = pvp2OrgName; } /** * @return the pvp2OrgDisplayName */ public String getPvp2OrgDisplayName() { return pvp2OrgDisplayName; } /** * @param pvp2OrgDisplayName the pvp2OrgDisplayName to set */ public void setPvp2OrgDisplayName(String pvp2OrgDisplayName) { this.pvp2OrgDisplayName = pvp2OrgDisplayName; } /** * @return the pvp2OrgURL */ public String getPvp2OrgURL() { return pvp2OrgURL; } /** * @param pvp2OrgURL the pvp2OrgURL to set */ public void setPvp2OrgURL(String pvp2OrgURL) { this.pvp2OrgURL = pvp2OrgURL; } /** * @return the pvp2Contact */ public ContactForm getPvp2Contact() { return pvp2Contact; } /** * @param pvp2Contact the pvp2Contact to set */ public void setPvp2Contact(ContactForm pvp2Contact) { this.pvp2Contact = pvp2Contact; } /** * @return the fileUpload */ public List getFileUpload() { return fileUpload; } /** * @param fileUpload the fileUpload to set */ public void setFileUpload(List fileUpload) { this.fileUpload = fileUpload; } /** * @return the fileUploadContentType */ public List getFileUploadContentType() { return fileUploadContentType; } /** * @param fileUploadContentType the fileUploadContentType to set */ public void setFileUploadContentType(List fileUploadContentType) { this.fileUploadContentType = fileUploadContentType; } /** * @return the fileUploadFileName */ public List getFileUploadFileName() { return fileUploadFileName; } /** * @param fileUploadFileName the fileUploadFileName to set */ public void setFileUploadFileName(List fileUploadFileName) { this.fileUploadFileName = fileUploadFileName; } /** * @return the ssoTarget */ public String getSsoTarget() { return ssoTarget; } /** * @param ssoTarget the ssoTarget to set */ public void setSsoTarget(String ssoTarget) { this.ssoTarget = ssoTarget; } /** * @return the ssoFriendlyName */ public String getSsoFriendlyName() { return ssoFriendlyName; } /** * @param ssoFriendlyName the ssoFriendlyName to set */ public void setSsoFriendlyName(String ssoFriendlyName) { this.ssoFriendlyName = ssoFriendlyName; } /** * @return the ssoPublicUrl */ public String getSsoPublicUrl() { return ssoPublicUrl; } /** * @param ssoPublicUrl the ssoPublicUrl to set */ public void setSsoPublicUrl(String ssoPublicUrl) { this.ssoPublicUrl = ssoPublicUrl; } /** * @return the ssoSpecialText */ public String getSsoSpecialText() { return ssoSpecialText; } /** * @param ssoSpecialText the ssoSpecialText to set */ public void setSsoSpecialText(String ssoSpecialText) { this.ssoSpecialText = ssoSpecialText; } /** * @return the ssoIdentificationNumber */ public String getSsoIdentificationNumber() { return ssoIdentificationNumber; } /** * @param ssoIdentificationNumber the ssoIdentificationNumber to set */ public void setSsoIdentificationNumber(String ssoIdentificationNumber) { this.ssoIdentificationNumber = ssoIdentificationNumber; } /** * @return the defaultchainigmode */ public String getDefaultchainigmode() { return defaultchainigmode; } /** * @param defaultchainigmode the defaultchainigmode to set */ public void setDefaultchainigmode(String defaultchainigmode) { this.defaultchainigmode = defaultchainigmode; } /** * @return the defaultBKUOnline */ public String getDefaultBKUOnline() { return defaultBKUOnline; } /** * @param defaultBKUOnline the defaultBKUOnline to set */ public void setDefaultBKUOnline(String defaultBKUOnline) { this.defaultBKUOnline = defaultBKUOnline; } /** * @return the defaultBKULocal */ public String getDefaultBKULocal() { return defaultBKULocal; } /** * @param defaultBKULocal the defaultBKULocal to set */ public void setDefaultBKULocal(String defaultBKULocal) { this.defaultBKULocal = defaultBKULocal; } /** * @return the defaultBKUHandy */ public String getDefaultBKUHandy() { return defaultBKUHandy; } /** * @param defaultBKUHandy the defaultBKUHandy to set */ public void setDefaultBKUHandy(String defaultBKUHandy) { this.defaultBKUHandy = defaultBKUHandy; } /** * @return the sLRequestTemplateOnline */ public String getSLRequestTemplateOnline() { return SLRequestTemplateOnline; } /** * @param sLRequestTemplateOnline the sLRequestTemplateOnline to set */ public void setSLRequestTemplateOnline(String sLRequestTemplateOnline) { SLRequestTemplateOnline = sLRequestTemplateOnline; } /** * @return the sLRequestTemplateLocal */ public String getSLRequestTemplateLocal() { return SLRequestTemplateLocal; } /** * @param sLRequestTemplateLocal the sLRequestTemplateLocal to set */ public void setSLRequestTemplateLocal(String sLRequestTemplateLocal) { SLRequestTemplateLocal = sLRequestTemplateLocal; } /** * @return the sLRequestTemplateHandy */ public String getSLRequestTemplateHandy() { return SLRequestTemplateHandy; } /** * @param sLRequestTemplateHandy the sLRequestTemplateHandy to set */ public void setSLRequestTemplateHandy(String sLRequestTemplateHandy) { SLRequestTemplateHandy = sLRequestTemplateHandy; } /** * @return the trustmanagerrevocationcheck */ public boolean isTrustmanagerrevocationcheck() { return trustmanagerrevocationcheck; } /** * @param trustmanagerrevocationcheck the trustmanagerrevocationcheck to set */ public void setTrustmanagerrevocationcheck(boolean trustmanagerrevocationcheck) { this.trustmanagerrevocationcheck = trustmanagerrevocationcheck; } /** * @return the trustedCACerts */ public String getTrustedCACerts() { return trustedCACerts; } /** * @param trustedCACerts the trustedCACerts to set */ public void setTrustedCACerts(String trustedCACerts) { this.trustedCACerts = trustedCACerts; } /** * @return the chainigmodelist */ public Map getChainigmodelist() { return chainigmodelist; } /** * @param chainigmodelist the chainigmodelist to set */ public void setChainigmodelist(Map chainigmodelist) { GeneralMOAIDConfig.chainigmodelist = chainigmodelist; } /** * @return the secLayerTransformation */ public Map getSecLayerTransformation() { return secLayerTransformation; } /** * @param secLayerTransformation the secLayerTransformation to set */ public void setSecLayerTransformation(Map secLayerTransformation) { this.secLayerTransformation = secLayerTransformation; } /** * @return the authTransformList */ public List getAuthTransformList() { return authTransformList; } /** * @param authTransformList the authTransformList to set */ public void setAuthTransformList(List authTransformList) { this.authTransformList = authTransformList; } public void setFileUpload(File fileUpload) { if (this.fileUpload == null) this.fileUpload = new ArrayList(); this.fileUpload.add(fileUpload); } public void setFileUploadContentType(String fileUploadContentType) { if (this.fileUploadContentType == null) this.fileUploadContentType = new ArrayList(); this.fileUploadContentType.add(fileUploadContentType); } public void setFileUploadFileName(String fileUploadFileName) { if (this.fileUploadFileName == null) this.fileUploadFileName = new ArrayList(); this.fileUploadFileName.add(fileUploadFileName); } }