aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki
diff options
context:
space:
mode:
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java350
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java47
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java33
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java93
4 files changed, 268 insertions, 255 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java
index b776255..0032dc6 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java
@@ -23,12 +23,6 @@
package at.gv.egovernment.moa.spss.server.iaik.pki;
-import iaik.pki.PKIProfile;
-import iaik.pki.pathvalidation.ValidationProfile;
-import iaik.pki.revocation.RevocationProfile;
-import iaik.pki.store.truststore.TrustStoreProfile;
-import iaik.pki.store.truststore.TrustStoreTypes;
-
import java.util.Arrays;
import at.gv.egovernment.moa.sig.tsl.exception.TslPKIException;
@@ -42,179 +36,195 @@ import at.gv.egovernment.moa.spss.server.iaik.pki.revocation.RevocationProfileIm
import at.gv.egovernment.moa.spss.server.iaik.pki.store.truststore.TrustStoreProfileImpl;
import at.gv.egovernment.moa.spss.tsl.TSLServiceFactory;
import at.gv.egovernment.moaspss.logging.Logger;
+import iaik.pki.PKIProfile;
+import iaik.pki.pathvalidation.ValidationProfile;
+import iaik.pki.revocation.RevocationProfile;
+import iaik.pki.store.truststore.TrustStoreProfile;
/**
* Implementation of the <code>PKIProfile</code> interface containing
* information needed for certificate path validation. It uses configuration
* data from the MOA configuration.
- *
+ *
* @author Patrick Peck
* @version $Id$
*/
public class PKIProfileImpl implements PKIProfile {
- /** Profile information for revocation checking. */
- private RevocationProfile revocationProfile;
- /** Profile information about the trust profile to use. */
- private TrustStoreProfile trustStoreProfile;
- /** Profile information about the certificate validation. */
- private ValidationProfile validationProfile;
- /**
- * The <code>ConfigurationProvider</code> to read the MOA configuration data
- * from.
- */
- private ConfigurationProvider config;
-
- /**
- * Create a new <code>PKIProfileImpl</code>.
- *
- * @param config
- * The MOA configuration providing configuration data about
- * certificate path validation.
- * @param trustProfileID
- * The trust profile ID denoting the location of the trust store.
- * @throws MOAApplicationException
- * An error occurred building the profile.
- */
- public PKIProfileImpl(ConfigurationProvider config, String trustProfileID) throws MOAApplicationException {
-
- this.config = config;
- setRevocationProfile(new RevocationProfileImpl(config));
- setValidationProfile(new ValidationProfileImpl(config));
-
- //generate TrustStoreProfile from TrustStore configuration
- internalTrustProfileBuilder(trustProfileID);
-
- }
-
-
- private void internalTrustProfileBuilder(String trustProfileId) throws MOAApplicationException {
- TrustProfile tp = (TrustProfile) config.getTrustProfile(trustProfileId);
- if (tp != null) {
- //build directory based trust store as default
-
-
- if (tp.isTSLEnabled()) {
- //build TSL truststore if enabled
- TslTrustStoreProfile tslTrustStore;
- try {
- tslTrustStore = TSLServiceFactory.getTSLServiceClient().
- buildTrustStoreProfile(
- tp.getCountries(),
- tp.getAllowedTspStatus(),
- tp.getAllowedTspServiceTypes(),
- trustProfileId + "_TSL");
-
- //build Directory based TrustStore
- TrustStoreProfileImpl directoryTrustStore = new TrustStoreProfileImpl(trustProfileId + "_Directory", tp.getUri());
-
- //generate a virtual truststore that concatenates the TSL TrustStore and the directory TrustStore
- ChainingTrustStoreProfile chainedProfile = new ChainingTrustStoreProfile(
- Arrays.asList(tslTrustStore, directoryTrustStore),
- trustProfileId);
-
- //set this virtual truststore
- setTrustStoreProfile(chainedProfile);
-
- } catch (TslPKIException e) {
- Logger.error("Virtual TSL based TrustProfile generation FAILED.", e);
- throw new MOAApplicationException("2900", new Object[] { trustProfileId });
-
- }
-
- } else
- setTrustStoreProfile(new TrustStoreProfileImpl(trustProfileId, tp.getUri()));
-
- } else {
- throw new MOAApplicationException("2203", new Object[] { trustProfileId });
-
- }
-
- }
-
- /**
- * @see iaik.pki.PKIProfile#autoAddCertificates()
- */
- /*public boolean autoAddCertificates() {
- return useAuthorityInfoAccess() ? true : config.getAutoAddCertificates();
- }*/
-
- /**
- * @see iaik.pki.PKIProfile#getRevocationProfile()
- */
- public RevocationProfile getRevocationProfile() {
- return revocationProfile;
- }
-
- /**
- * Sets the <code>RevocationProfile</code>.
- *
- * @param revocationProfile
- * The <code>RevocationProfile</code> used for revocation
- * checking.
- */
- protected void setRevocationProfile(RevocationProfile revocationProfile) {
- this.revocationProfile = revocationProfile;
- }
-
- /**
- * @see iaik.pki.PKIProfile#getTrustStoreProfile()
- */
- public TrustStoreProfile getTrustStoreProfile() {
- return trustStoreProfile;
- }
-
- /**
- * Sets the <code>TrustStoreProfile</code>.
- *
- * @param trustStoreProfile
- * The <code>TrustStoreProfile</code>.
- */
- protected void setTrustStoreProfile(TrustStoreProfile trustStoreProfile) {
- this.trustStoreProfile = trustStoreProfile;
- }
-
- /**
- * @see iaik.pki.PKIProfile#getValidationProfile()
- */
- public ValidationProfile getValidationProfile() {
- return validationProfile;
- }
-
- /**
- * Sets the <code>ValidationProfile</code>.
- *
- * @param validationProfile
- * The <code>ValidationProfile</code> to set.
- */
- protected void setValidationProfile(ValidationProfile validationProfile) {
- this.validationProfile = validationProfile;
- }
-
- /**
- * @see iaik.pki.PKIProfile#useAuthorityInfoAccess()
- */
- public boolean useAuthorityInfoAccess() {
- return config.getUseAuthorityInfoAccess();
- }
-
- /**
- * @see iaik.pki.PKIProfile#autoAddCertificates()
- */
- @Override
- public int autoAddCertificates() {
- if(config.getAutoAddCertificates()) {
- return PKIProfile.AUTO_ADD_EE_DISABLE;
- } else {
- return PKIProfile.AUTO_ADD_DISABLE;
- }
- // TODO AFITZEK allow saving of end entity certificates
- }
-
- @Override
- public TrustStoreProfile getIndirectRevocationTrustStoreProfile() {
- // TODO AFITZEK IMPLEMENT THIS METHOD
- return null;
- }
+ /** Profile information for revocation checking. */
+ private RevocationProfile revocationProfile;
+ /** Profile information about the trust profile to use. */
+ private TrustStoreProfile trustStoreProfile;
+ /** Profile information about the certificate validation. */
+ private ValidationProfile validationProfile;
+ /**
+ * The <code>ConfigurationProvider</code> to read the MOA configuration data
+ * from.
+ */
+ private final ConfigurationProvider config;
+
+ /**
+ * Create a new <code>PKIProfileImpl</code>.
+ *
+ * @param config The MOA configuration providing configuration data
+ * about certificate path validation.
+ * @param trustProfileID The trust profile ID denoting the location of the trust
+ * store.
+ * @throws MOAApplicationException An error occurred building the profile.
+ */
+ public PKIProfileImpl(ConfigurationProvider config, String trustProfileID) throws MOAApplicationException {
+
+ this.config = config;
+ setRevocationProfile(new RevocationProfileImpl(config));
+ setValidationProfile(new ValidationProfileImpl(config));
+
+ // generate TrustStoreProfile from TrustStore configuration
+ internalTrustProfileBuilder(trustProfileID);
+
+ }
+
+ private void internalTrustProfileBuilder(String trustProfileId) throws MOAApplicationException {
+ final TrustProfile tp = config.getTrustProfile(trustProfileId);
+ if (tp != null) {
+ // build directory based trust store as default
+
+ if (tp.isTSLEnabled()) {
+ TslTrustStoreProfile tslTrustStore;
+ try {
+ if (!TSLServiceFactory.isInitialized()) {
+ Logger.error("Can not build TrustProfile:" + trustProfileId
+ + " Reason: TrustProfile needs TSL support but TSL client NOT initialized.");
+ throw new TslPKIException("Trust Status-List service client is NOT initialized");
+
+ }
+
+ // build TSL truststore if enabled
+ tslTrustStore = TSLServiceFactory.getTSLServiceClient().buildTrustStoreProfile(
+ tp.getCountries(),
+ tp.getAllowedTspStatus(),
+ tp.getAllowedTspServiceTypes(),
+ trustProfileId + "_TSL");
+
+ // build Directory based TrustStore
+ final TrustStoreProfileImpl directoryTrustStore = new TrustStoreProfileImpl(trustProfileId
+ + "_Directory", tp.getUri());
+
+ // generate a virtual truststore that concatenates the TSL TrustStore and the
+ // directory TrustStore
+ final ChainingTrustStoreProfile chainedProfile = new ChainingTrustStoreProfile(
+ Arrays.asList(tslTrustStore, directoryTrustStore),
+ trustProfileId);
+
+ // set this virtual truststore
+ setTrustStoreProfile(chainedProfile);
+
+ } catch (final TslPKIException e) {
+ Logger.error("Virtual TSL based TrustProfile generation FAILED.", e);
+ throw new MOAApplicationException("2900", new Object[] { trustProfileId });
+
+ }
+
+ } else {
+ setTrustStoreProfile(new TrustStoreProfileImpl(trustProfileId, tp.getUri()));
+ }
+
+ } else {
+ throw new MOAApplicationException("2203", new Object[] { trustProfileId });
+
+ }
+
+ }
+
+ /**
+ * @see iaik.pki.PKIProfile#autoAddCertificates()
+ */
+ /*
+ * public boolean autoAddCertificates() { return useAuthorityInfoAccess() ? true
+ * : config.getAutoAddCertificates(); }
+ */
+
+ /**
+ * @see iaik.pki.PKIProfile#getRevocationProfile()
+ */
+ @Override
+ public RevocationProfile getRevocationProfile() {
+ return revocationProfile;
+ }
+
+ /**
+ * Sets the <code>RevocationProfile</code>.
+ *
+ * @param revocationProfile The <code>RevocationProfile</code> used for
+ * revocation checking.
+ */
+ protected void setRevocationProfile(RevocationProfile revocationProfile) {
+ this.revocationProfile = revocationProfile;
+ }
+
+ /**
+ * @see iaik.pki.PKIProfile#getTrustStoreProfile()
+ */
+ @Override
+ public TrustStoreProfile getTrustStoreProfile() {
+ return trustStoreProfile;
+ }
+
+ /**
+ * Sets the <code>TrustStoreProfile</code>.
+ *
+ * @param trustStoreProfile The <code>TrustStoreProfile</code>.
+ */
+ protected void setTrustStoreProfile(TrustStoreProfile trustStoreProfile) {
+ this.trustStoreProfile = trustStoreProfile;
+ }
+
+ /**
+ * @see iaik.pki.PKIProfile#getValidationProfile()
+ */
+ @Override
+ public ValidationProfile getValidationProfile() {
+ return validationProfile;
+ }
+
+ /**
+ * Sets the <code>ValidationProfile</code>.
+ *
+ * @param validationProfile The <code>ValidationProfile</code> to set.
+ */
+ protected void setValidationProfile(ValidationProfile validationProfile) {
+ this.validationProfile = validationProfile;
+ }
+
+ /**
+ * @see iaik.pki.PKIProfile#useAuthorityInfoAccess()
+ */
+ @Override
+ public boolean useAuthorityInfoAccess() {
+ return config.getUseAuthorityInfoAccess();
+ }
+
+ /**
+ * @see iaik.pki.PKIProfile#autoAddCertificates()
+ */
+ @Override
+ public int autoAddCertificates() {
+ if (config.getAutoAddCertificates()) {
+ if (config.getAutoAddEECertificates()) {
+ return PKIProfile.AUTO_ADD_ENABLE;
+ } else {
+ return PKIProfile.AUTO_ADD_EE_DISABLE;
+ }
+
+ } else {
+ return PKIProfile.AUTO_ADD_DISABLE;
+ }
+
+ }
+
+ @Override
+ public TrustStoreProfile getIndirectRevocationTrustStoreProfile() {
+ // TODO AFITZEK IMPLEMENT THIS METHOD
+ return null;
+ }
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java
index 7e62d60..76e1ed0 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java
@@ -21,40 +21,39 @@
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.server.iaik.pki.pathvalidation;
-import iaik.pki.pathvalidation.ValidationProfile;
-
import java.util.Collections;
import java.util.Set;
import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
+import iaik.pki.pathvalidation.ValidationProfile;
/**
* An implementation of the <code>ValidationProfile</code> interface providing
- * information about certificat path validation.
- *
+ * information about certificat path validation.
+ *
* @author Patrick Peck
* @version $Id$
*/
public class ValidationProfileImpl implements ValidationProfile {
- /** The <code>ConfigurationProvider</code> to read the configuration data
- * from. */
- private ConfigurationProvider config;
- private boolean initialAnyPolicyInhibit;
- private boolean initialExplicitPolicy;
- private boolean initialPolicyMappingInhibit;
- private Set initialPolicySet;
- private boolean nameConstraintsProcessing;
- private boolean policyProcessing;
+ /**
+ * The <code>ConfigurationProvider</code> to read the configuration data from.
+ */
+ private final ConfigurationProvider config;
+ private final boolean initialAnyPolicyInhibit;
+ private final boolean initialExplicitPolicy;
+ private final boolean initialPolicyMappingInhibit;
+ private final Set initialPolicySet;
+ private final boolean nameConstraintsProcessing;
+ private final boolean policyProcessing;
/**
* Create a new <code>ValidationProfileImpl</code> object.
- *
+ *
* This objects's fields are preset to the following values:
- *
+ *
* <ul>
* <li><code>initialAnyPolicyInhibit = true</code></li>
* <li><code>initialExplicitPoliy = true</code></li>
@@ -64,9 +63,9 @@ public class ValidationProfileImpl implements ValidationProfile {
* <li><code>nameConstraintsProcessing = false</code></li>
* <li><code>revocationChecking = false</code></li>
* </ul>
- *
- * @param config MOA configuration data for additional configuration
- * information (currently unused).
+ *
+ * @param config MOA configuration data for additional configuration information
+ * (currently unused).
*/
public ValidationProfileImpl(ConfigurationProvider config) {
this.config = config;
@@ -81,6 +80,7 @@ public class ValidationProfileImpl implements ValidationProfile {
/**
* @see iaik.pki.pathvalidation.ValidationProfile#getInitialAnyPolicyInhibit()
*/
+ @Override
public boolean getInitialAnyPolicyInhibit() {
return initialAnyPolicyInhibit;
}
@@ -88,6 +88,7 @@ public class ValidationProfileImpl implements ValidationProfile {
/**
* @see iaik.pki.pathvalidation.ValidationProfile#getInitialExplicitPolicy()
*/
+ @Override
public boolean getInitialExplicitPolicy() {
return initialExplicitPolicy;
}
@@ -95,6 +96,7 @@ public class ValidationProfileImpl implements ValidationProfile {
/**
* @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicyMappingInhibit()
*/
+ @Override
public boolean getInitialPolicyMappingInhibit() {
return initialPolicyMappingInhibit;
}
@@ -102,6 +104,7 @@ public class ValidationProfileImpl implements ValidationProfile {
/**
* @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicySet()
*/
+ @Override
public Set getInitialPolicySet() {
return initialPolicySet;
}
@@ -109,6 +112,7 @@ public class ValidationProfileImpl implements ValidationProfile {
/**
* @see iaik.pki.pathvalidation.ValidationProfile#getPolicyProcessing()
*/
+ @Override
public boolean getPolicyProcessing() {
return policyProcessing;
}
@@ -116,6 +120,7 @@ public class ValidationProfileImpl implements ValidationProfile {
/**
* @see iaik.pki.pathvalidation.ValidationProfile#getNameConstraintsProcessing()
*/
+ @Override
public boolean getNameConstraintsProcessing() {
return nameConstraintsProcessing;
}
@@ -123,8 +128,8 @@ public class ValidationProfileImpl implements ValidationProfile {
/**
* @see iaik.pki.pathvalidation.ValidationProfile#getRevocationChecking()
*/
- public boolean getRevocationChecking()
- {
+ @Override
+ public boolean getRevocationChecking() {
return config.getEnableRevocationChecking();
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java
index 14627b2..5215131 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java
@@ -21,37 +21,37 @@
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.server.iaik.pki.revocation;
import java.security.cert.X509Certificate;
+import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
import iaik.pki.revocation.RevocationProfile;
import iaik.pki.revocation.RevocationSourceTypes;
-import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
-
/**
* An implementation of the <code>RevocationProfile</code> interface providing
* information about revocation status checking, based on MOA configuration
* data.
- *
+ *
* @author Patrick Peck
* @version $Id$
*/
public class RevocationProfileImpl implements RevocationProfile {
/** The default service order. */
private static final String[] DEFAULT_SERVICE_ORDER =
- { RevocationSourceTypes.CRL, RevocationSourceTypes.OCSP };
- /** The <code>ConfigurationProvider</code> to read the MOA configuration data
- * from. */
- private ConfigurationProvider config;
+ { RevocationSourceTypes.CRL, RevocationSourceTypes.OCSP };
+ /**
+ * The <code>ConfigurationProvider</code> to read the MOA configuration data
+ * from.
+ */
+ private final ConfigurationProvider config;
/** The OCSP request hash algorithm. Currently only "SHA" is supported. */
private static final String oCSPRequestHashAlgorithm = "SHA";
/**
* Create a new <code>RevocationProfileImpl</code>.
- *
+ *
* @param config The MOA configuration data.
*/
public RevocationProfileImpl(ConfigurationProvider config) {
@@ -63,14 +63,15 @@ public class RevocationProfileImpl implements RevocationProfile {
/**
* @see iaik.pki.revocation.RevocationProfile#getMaxRevocationAge(String)
*/
- public long getMaxRevocationAge(String distributionPointUri)
- {
+ @Override
+ public long getMaxRevocationAge(String distributionPointUri) {
return config.getMaxRevocationAge();
}
/**
* @see iaik.pki.revocation.RevocationProfile#getOCSPRequestHashAlgorithm()
*/
+ @Override
public String getOCSPRequestHashAlgorithm() {
return oCSPRequestHashAlgorithm;
}
@@ -78,10 +79,12 @@ public class RevocationProfileImpl implements RevocationProfile {
/**
* @see iaik.pki.revocation.RevocationProfile#getPreferredServiceOrder(java.security.cert.X509Certificate)
*/
- public String[] getPreferredServiceOrder(X509Certificate cert)
- {
- String[] serviceOrder = config.getServiceOrder();
- if (serviceOrder == null || serviceOrder.length == 0) return DEFAULT_SERVICE_ORDER;
+ @Override
+ public String[] getPreferredServiceOrder(X509Certificate cert) {
+ final String[] serviceOrder = config.getServiceOrder();
+ if (serviceOrder == null || serviceOrder.length == 0) {
+ return DEFAULT_SERVICE_ORDER;
+ }
return serviceOrder;
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java
index c9f4f28..9ef3764 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java
@@ -21,89 +21,82 @@
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.server.iaik.pki.store.truststore;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
-import iaik.pki.store.truststore.TrustStoreProfile;
-import iaik.pki.store.truststore.TrustStoreTypes;
-import iaik.pki.store.observer.NotificationData;
-import iaik.pki.store.observer.Observer;
-
import at.gv.egovernment.moa.spss.MOAApplicationException;
import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
import at.gv.egovernment.moa.spss.server.config.TrustProfile;
+import iaik.pki.store.observer.NotificationData;
+import iaik.pki.store.observer.Observer;
+import iaik.pki.store.truststore.TrustStoreProfile;
+import iaik.pki.store.truststore.TrustStoreTypes;
/**
* An implementation of the <code>TrustStoreProfile</code> interface, using data
* from the MOA configuration.
- *
- * @see iaik.pki.store.truststore.TrustStoreProfile
+ *
+ * @see iaik.pki.store.truststore.TrustStoreProfile
* @author Patrick Peck
* @version $Id$
*/
public class TrustStoreProfileImpl implements TrustStoreProfile {
/** The observers of this profile. */
- private List observers = new ArrayList();
-
+ private final List observers = new ArrayList();
+
/**
- * The trust profile identifier.
+ * The trust profile identifier.
*/
private String id_;
-
+
/** The type of the trust profile. */
private String type;
- /** The URI of the trust profile.*/
+ /** The URI of the trust profile. */
private String URI;
-
/**
* Create a new <code>TrustStoreProfileImpl</code>.
- *
- * @param config The MOA configuration data, from which trust store
- * configuration data is read.
+ *
+ * @param config The MOA configuration data, from which trust store
+ * configuration data is read.
* @param trustProfileId The trust profile id on which this
- * <code>TrustStoreProfile</code> is based.
- * @throws MOAApplicationException The <code>trustProfileId</code> could not
- * be found in the MOA configuration.
+ * <code>TrustStoreProfile</code> is based.
+ * @throws MOAApplicationException The <code>trustProfileId</code> could not be
+ * found in the MOA configuration.
*/
public TrustStoreProfileImpl(String trustProfileId, String trustProfileUri)
- throws MOAApplicationException {
- id_ = trustProfileId;
- setURI(trustProfileUri);
- setType(TrustStoreTypes.DIRECTORY);
-
+ throws MOAApplicationException {
+ id_ = trustProfileId;
+ setURI(trustProfileUri);
+ setType(TrustStoreTypes.DIRECTORY);
+
}
-
+
/**
* Create a new <code>TrustStoreProfileImpl</code>.
- *
- * @param config The MOA configuration data, from which trust store
- * configuration data is read.
+ *
+ * @param config The MOA configuration data, from which trust store
+ * configuration data is read.
* @param trustProfileId The trust profile id on which this
- * <code>TrustStoreProfile</code> is based.
- * @throws MOAApplicationException The <code>trustProfileId</code> could not
- * be found in the MOA configuration.
+ * <code>TrustStoreProfile</code> is based.
+ * @throws MOAApplicationException The <code>trustProfileId</code> could not be
+ * found in the MOA configuration.
*/
@Deprecated
public TrustStoreProfileImpl(
- ConfigurationProvider config,
- String trustProfileId)
- throws MOAApplicationException {
+ ConfigurationProvider config,
+ String trustProfileId)
+ throws MOAApplicationException {
- TrustProfile tp = (TrustProfile) config.getTrustProfile(trustProfileId);
- if (tp != null)
- {
+ final TrustProfile tp = config.getTrustProfile(trustProfileId);
+ if (tp != null) {
id_ = trustProfileId;
setURI(tp.getUri());
setType(TrustStoreTypes.DIRECTORY);
- }
- else
- {
+ } else {
throw new MOAApplicationException("2203", new Object[] { trustProfileId });
}
}
@@ -111,14 +104,15 @@ public class TrustStoreProfileImpl implements TrustStoreProfile {
/**
* @see iaik.pki.store.truststore.TrustStoreProfile#getType()
*/
+ @Override
public String getType() {
return type;
}
/**
* Sets the the trust store type.
- *
- * @param type The trust store type to set.
+ *
+ * @param type The trust store type to set.
*/
protected void setType(String type) {
this.type = type;
@@ -127,13 +121,14 @@ public class TrustStoreProfileImpl implements TrustStoreProfile {
/**
* @see iaik.pki.store.truststore.TrustStoreProfile#getURI()
*/
+ @Override
public String getURI() {
return URI;
}
/**
* Sets the trust store URI.
- *
+ *
* @param URI The trust store URI to set.
*/
protected void setURI(String URI) {
@@ -162,8 +157,8 @@ public class TrustStoreProfileImpl implements TrustStoreProfile {
* @see iaik.pki.store.observer.Observable#notify(iaik.pki.store.observer.NotificationData)
*/
public void notify(NotificationData notificationData) {
- for (Iterator iter = observers.iterator(); iter.hasNext();) {
- Observer observer = (Observer) iter.next();
+ for (final Object observer2 : observers) {
+ final Observer observer = (Observer) observer2;
observer.notify(notificationData);
}
}
@@ -171,8 +166,8 @@ public class TrustStoreProfileImpl implements TrustStoreProfile {
/**
* @see iaik.pki.store.truststore.TrustStoreProfile#getId()
*/
- public String getId()
- {
+ @Override
+ public String getId() {
return id_;
}