/*
* Copyright 2003 Federal Chancellery Austria
* MOA-SPSS has been developed in a cooperation between BRZ, the Federal
* Chancellery Austria - ICT staff unit, and Graz University of Technology.
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
* http://www.osor.eu/eupl/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
* This product combines work with different licenses. See the "NOTICE" text
* file for details on the various modules and licenses.
* The "NOTICE" text file is part of the distribution. Any derivative works
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
package at.gv.egovernment.moa.spss.server.iaik.config;
import iaik.pki.PKIConfiguration;
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.spss.server.config.ConfigurationProvider;
/**
* An implementation of the PKIConfiguration
interface using data
* from the MOA configuration.
*
* @see iaik.pki.PKIConfiguration
* @author Patrick Peck
* @version $Id$
*/
public class PKIConfigurationImpl implements PKIConfiguration {
/** The CertStore
configuration. */
private CertStoreConfiguration certStoreConfiguration;
/** The revocation checking configuration. */
private RevocationConfiguration revocationConfiguration;
/** The revocation archive configuration. */
private ArchiveConfiguration archiveConfiguration;
/** The certificate validation configuration. */
private ValidationConfiguration validationConfiguration;
private int connectionTimeout;
private int readTimeout;
/**
* Create a new PKIConfigurationImpl
.
*
* @param config
* The underlying MOA configuration which will be used to build
* the configuration data contained in this object.
*/
public PKIConfigurationImpl(ConfigurationProvider config) {
this.certStoreConfiguration = new CertStoreConfigurationImpl(config);
this.revocationConfiguration = new RevocationConfigurationImpl(config);
boolean archiveInfo = config.getEnableRevocationArchiving();
if (archiveInfo) {
this.archiveConfiguration = new ArchiveConfigurationImpl(config);
} else {
this.archiveConfiguration = null;
}
this.validationConfiguration = new ValidationConfigurationImpl(config);
this.connectionTimeout = config.getConnectionTimeout();
this.readTimeout = config.getReadTimeout();
}
/**
* @see iaik.pki.PKIConfiguration#getCertStoreConfiguration()
*/
public CertStoreConfiguration getCertStoreConfiguration() {
return certStoreConfiguration;
}
/**
* @see iaik.pki.PKIConfiguration#getRevocationConfiguration()
*/
public RevocationConfiguration getRevocationConfiguration() {
return revocationConfiguration;
}
/**
* @see iaik.pki.PKIConfiguration#getArchiveConfiguration()
*/
public ArchiveConfiguration getArchiveConfiguration() {
return archiveConfiguration;
}
/**
* @see iaik.pki.PKIConfiguration#getValidationConfiguration()
*/
public ValidationConfiguration getValidationConfiguration() {
return validationConfiguration;
}
@Override
public int getConnectTimeout() {
return this.connectionTimeout;
}
@Override
public int getReadTimeout() {
return this.readTimeout;
}
}