diff options
author | gregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-08-05 12:13:37 +0000 |
---|---|---|
committer | gregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-08-05 12:13:37 +0000 |
commit | 664d28dce2c23cd324fae76c40ad07b023e27129 (patch) | |
tree | f485cf16a8622c92a754c7d3185ee342e4878f1e /spss.server/src/at/gv/egovernment/moa/spss/server/iaik | |
parent | 4f170b89a4ec0581b6701892522f0a808b28290b (diff) | |
download | moa-id-spss-664d28dce2c23cd324fae76c40ad07b023e27129.tar.gz moa-id-spss-664d28dce2c23cd324fae76c40ad07b023e27129.tar.bz2 moa-id-spss-664d28dce2c23cd324fae76c40ad07b023e27129.zip |
Bug 271: Adpation auf neue Struktur des Konfigurationsfiles abgeschlossen. Noch ungetestet.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@414 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/iaik')
10 files changed, 76 insertions, 168 deletions
diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java index daff07bd2..bf56d437c 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java @@ -28,23 +28,17 @@ public class ArchiveConfigurationImpl /** * Create a new <code>ArchiveConfigurationImpl</code>. * - * @param config The MOA configuration from which the configuration data is - * being read. + * @param config The MOA configuration from which the configuration data is being read. */ - public ArchiveConfigurationImpl(ConfigurationProvider config) { - String jdbcUrl = - config.getGenericConfiguration( - ConfigurationProvider.DATABASE_ARCHIVE_PARAMETER_URL_PROPERTY); - - if (jdbcUrl != null) { - this.archiveParameters = new DataBaseArchiveParameterImpl(jdbcUrl); - } + public ArchiveConfigurationImpl(ConfigurationProvider config) + { + String jdbcUrl = config.getRevocationArchiveJDBCURL(); + this.archiveParameters = new DataBaseArchiveParameterImpl(jdbcUrl); - // Register JDBC driver class specified in generic configuration parameters - String jdbcDriverClass = config.getGenericConfiguration( - ConfigurationProvider.DATABASE_ARCHIVE_PARAMETER_DRIVERCLASS_PROPERTY); - if (jdbcDriverClass != null) + // Register JDBC driver class + if (jdbcUrl != null) { + String jdbcDriverClass = config.getRevocationArchiveJDBCDriverClass(); try { Class.forName(jdbcDriverClass); diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CRLDistributionPointAdapter.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CRLDistributionPointAdapter.java deleted file mode 100644 index 1c2df80a5..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CRLDistributionPointAdapter.java +++ /dev/null @@ -1,54 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.pki.revocation.CRLDistributionPoint; -import iaik.pki.revocation.RevocationSourceTypes; - -import at.gv.egovernment.moa.spss.server.config.DistributionPoint; - -/** - * A class that wraps an - * at.gv.egovernment.moa.spss.server.config.DistributionPoint as a - * iaik.pki.revocation.CRLDistributionPoint. - * - * @see iaik.pki.revocation.CRLDistributionPoint - * @author Patrick Peck - * @version $Id$ - */ -public class CRLDistributionPointAdapter implements CRLDistributionPoint { - - /** The wrapped <code>DistributionPoint</code>. */ - private DistributionPoint distributionPoint; - - /** - * Create a new <code>CRLDistributionPointAdapter</code>. - * - * @param distributionPoint The <code>DistributionPoint</code> to wrap. It - * contains the data configured in the MOA configuration. - */ - public CRLDistributionPointAdapter(DistributionPoint distributionPoint) { - this.distributionPoint = distributionPoint; - } - - /** - * @see iaik.pki.revocation.CRLDistributionPoint#getReasonCodes() - */ - public int getReasonCodes() { - return distributionPoint.getReasonCodes(); - } - - /** - * @return <code>RevocationSourceTypes.CRL</code> - * @see iaik.pki.revocation.DistributionPoint#getType() - */ - public String getType() { - return RevocationSourceTypes.CRL; - } - - /** - * @see iaik.pki.revocation.DistributionPoint#getUri() - */ - public String getUri() { - return distributionPoint.getUri(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java index c9be3fc2b..e6e084e11 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java @@ -27,21 +27,17 @@ public class CertStoreConfigurationImpl * @param config The MOA configuration from which the configuration data is * being read. */ - public CertStoreConfigurationImpl(ConfigurationProvider config) { - String certStoreRoot = - config.getGenericConfiguration( - ConfigurationProvider.DIRECTORY_CERTSTORE_PARAMETER_PROPERTY, - "certstore"); - - if (certStoreRoot != null) { - DirectoryCertStoreParameters dirParameters = - new DirectoryCertStoreParametersImpl( - "MOA Directory CertStore", - certStoreRoot, - true, - false); - parameters = new CertStoreParameters[] { dirParameters }; - } + public CertStoreConfigurationImpl(ConfigurationProvider config) + { + String certStoreRoot = config.getCertStoreLocation(); + + DirectoryCertStoreParameters dirParameters = new DirectoryCertStoreParametersImpl( + "MOA Directory CertStore", + certStoreRoot, + true, + false); + + parameters = new CertStoreParameters[] { dirParameters }; } /** diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java index 6562ef1f4..a7ec91472 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java @@ -61,7 +61,7 @@ public class IaikConfigurator { dumpKeyEntryIDs(); checkKeyGroupConfig(moaConfig); - TrustStoreFactory.reset(); + TrustStoreFactory.removeAllHandlers(); } catch (iaik.server.ConfigurationException e) { throw new ConfigurationException("config.08", null, e); } catch (Throwable t) { diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java index 0703cd326..1c42cc4af 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java @@ -5,9 +5,6 @@ import iaik.pki.pathvalidation.ValidationConfiguration; import iaik.pki.revocation.RevocationConfiguration; import iaik.pki.store.certstore.CertStoreConfiguration; import iaik.pki.store.revocation.archive.ArchiveConfiguration; - -import at.gv.egovernment.moa.util.BoolUtils; - import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; /** @@ -35,19 +32,17 @@ public class PKIConfigurationImpl implements PKIConfiguration { * the configuration data contained in this object. */ public PKIConfigurationImpl(ConfigurationProvider config) { - String archiveInfo; this.certStoreConfiguration = new CertStoreConfigurationImpl(config); - this.revocationConfiguration = new RevocationConfigurationImpl(config); - archiveInfo = - config.getGenericConfiguration( - ConfigurationProvider.ARCHIVE_REVOCATION_INFO_PROPERTY, - "false"); - if (archiveInfo != null && BoolUtils.valueOf(archiveInfo)) { + boolean archiveInfo = config.getEnableRevocationArchiving(); + if (archiveInfo) + { this.archiveConfiguration = new ArchiveConfigurationImpl(config); - } else { + } + else + { this.archiveConfiguration = null; } diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java index 466234a11..bccb04a09 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java @@ -1,16 +1,11 @@ package at.gv.egovernment.moa.spss.server.iaik.config; +import iaik.pki.revocation.RevocationConfiguration; + import java.security.cert.X509Certificate; import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; import java.util.Set; -import iaik.pki.revocation.RevocationConfiguration; - -import at.gv.egovernment.moa.util.BoolUtils; - -import at.gv.egovernment.moa.spss.server.config.DistributionPoint; import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; /** @@ -40,34 +35,19 @@ public class RevocationConfigurationImpl } /** - * @see iaik.pki.revocation.RevocationConfiguration#getAlternativeDistributionPoints(java.security.cert.X509Certificate, java.util.Date) + * @see iaik.pki.revocation.RevocationConfiguration#getAlternativeDistributionPoints */ - public Set getAlternativeDistributionPoints( - X509Certificate cert, - Date date) { - - Set configuredPoints = config.getCRLDP(cert); - Set distributionPoints = new HashSet(); - Iterator iter; - - for (iter = configuredPoints.iterator(); iter.hasNext();) { - DistributionPoint dp = (DistributionPoint) iter.next(); - distributionPoints.add(new CRLDistributionPointAdapter(dp)); - } - - return distributionPoints; + public Set getAlternativeDistributionPoints(X509Certificate cert, X509Certificate issuer, Date date) + { + return config.getDistributionPoints(cert); } /** * @see iaik.pki.revocation.RevocationConfiguration#archiveRevocationInfo(java.lang.String, java.lang.String) */ - public boolean archiveRevocationInfo(String type, String uri) { - String info = - config.getGenericConfiguration( - ConfigurationProvider.ARCHIVE_REVOCATION_INFO_PROPERTY, - "false"); - - return info != null ? BoolUtils.valueOf(info) : false; + public boolean archiveRevocationInfo(String type, String uri) + { + return config.getEnableRevocationArchiving(); } } diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java index c204eface..76f03ae07 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java @@ -4,9 +4,6 @@ import iaik.pki.PKIProfile; import iaik.pki.pathvalidation.ValidationProfile; import iaik.pki.revocation.RevocationProfile; import iaik.pki.store.truststore.TrustStoreProfile; - -import at.gv.egovernment.moa.util.BoolUtils; - import at.gv.egovernment.moa.spss.MOAApplicationException; import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; import at.gv.egovernment.moa.spss.server.iaik.pki.pathvalidation.ValidationProfileImpl; @@ -54,14 +51,9 @@ public class PKIProfileImpl implements PKIProfile { /** * @see iaik.pki.PKIProfile#autoAddCertificates() */ - public boolean autoAddCertificates() { - String boolStr = - config.getGenericConfiguration( - ConfigurationProvider.AUTO_ADD_CERTIFICATES_PROPERTY, - "true"); - boolean boolValue = BoolUtils.valueOf(boolStr); - - return useAuthorityInfoAccess() ? true : boolValue; + public boolean autoAddCertificates() + { + return useAuthorityInfoAccess() ? true : config.getAutoAddCertificates(); } /** @@ -116,12 +108,9 @@ public class PKIProfileImpl implements PKIProfile { /** * @see iaik.pki.PKIProfile#useAuthorityInfoAccess() */ - public boolean useAuthorityInfoAccess() { - String boolStr = - config.getGenericConfiguration( - ConfigurationProvider.USE_AUTHORITY_INFO_ACCESS_PROPERTY, - "true"); - return BoolUtils.valueOf(boolStr); + public boolean useAuthorityInfoAccess() + { + return config.getUseAuthorityInfoAccess(); } } diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java index a2e3d6766..a4d7ea7fa 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java @@ -2,13 +2,11 @@ package at.gv.egovernment.moa.spss.server.iaik.pki.pathvalidation; import iaik.pki.pathvalidation.ValidationProfile; -import at.gv.egovernment.moa.util.BoolUtils; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - import java.util.Collections; import java.util.Set; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + /** * An implementation of the <code>ValidationProfile</code> interface providing * information about certificat path validation. @@ -101,13 +99,9 @@ public class ValidationProfileImpl implements ValidationProfile { /** * @see iaik.pki.pathvalidation.ValidationProfile#getRevocationChecking() */ - public boolean getRevocationChecking() { - String checkingStr = - config.getGenericConfiguration( - ConfigurationProvider.REVOCATION_CHECKING_PROPERTY, - "true"); - - return BoolUtils.valueOf(checkingStr); + public boolean getRevocationChecking() + { + return config.getEnableRevocationChecking(); } }
\ No newline at end of file diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java index 186d24934..164ae8a75 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java @@ -18,7 +18,7 @@ import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; public class RevocationProfileImpl implements RevocationProfile { /** The default service order. */ private static final String[] DEFAULT_SERVICE_ORDER = - { RevocationSourceTypes.CRL }; + { RevocationSourceTypes.OCSP, RevocationSourceTypes.CRL }; /** The <code>ConfigurationProvider</code> to read the MOA configuration data * from. */ private ConfigurationProvider config; @@ -38,14 +38,9 @@ public class RevocationProfileImpl implements RevocationProfile { /** * @see iaik.pki.revocation.RevocationProfile#getMaxRevocationAge(String) */ - public long getMaxRevocationAge(String distributionPointUri) { - String maxRevocationAgeStr = - config.getGenericConfiguration( - ConfigurationProvider.MAX_REVOCATION_AGE_PROPERTY, - "0"); - long revocationAge = Long.parseLong(maxRevocationAgeStr); - - return revocationAge; + public long getMaxRevocationAge(String distributionPointUri) + { + return config.getMaxRevocationAge(); } /** @@ -58,8 +53,11 @@ public class RevocationProfileImpl implements RevocationProfile { /** * @see iaik.pki.revocation.RevocationProfile#getPreferredServiceOrder(java.security.cert.X509Certificate) */ - public String[] getPreferredServiceOrder(X509Certificate cert) { - return DEFAULT_SERVICE_ORDER; + public String[] getPreferredServiceOrder(X509Certificate cert) + { + String[] serviceOrder = config.getServiceOrder(); + if (serviceOrder == null || serviceOrder.length == 0) return DEFAULT_SERVICE_ORDER; + return serviceOrder; } } diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java index 8a1161b95..37ded77e6 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java @@ -25,6 +25,12 @@ public class TrustStoreProfileImpl implements TrustStoreProfile { /** The observers of this profile. */ private List observers = new ArrayList(); + + /** + * The trust profile identifier. + */ + private String id_; + /** The type of the trust profile. */ private String type; /** The URI of the trust profile.*/ @@ -46,13 +52,15 @@ public class TrustStoreProfileImpl implements TrustStoreProfile { throws MOAApplicationException { TrustProfile tp = (TrustProfile) config.getTrustProfile(trustProfileId); - if (tp != null) { + if (tp != null) + { + id_ = trustProfileId; setURI(tp.getUri()); setType(TrustStoreTypes.DIRECTORY); - } else { - throw new MOAApplicationException( - "2203", - new Object[] { trustProfileId }); + } + else + { + throw new MOAApplicationException("2203", new Object[] { trustProfileId }); } } @@ -116,4 +124,12 @@ public class TrustStoreProfileImpl implements TrustStoreProfile { } } + /** + * @see iaik.pki.store.truststore.TrustStoreProfile#getId() + */ + public String getId() + { + return id_; + } + } |