[java-identity-provider] branch master updated: IDP-1432 Remove deprecated "api" methods

Rod Widdowson rdw at steadingsoftware.com
Tue Mar 26 12:24:38 EDT 2019


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=34855d05261196d1e16f4c3b1efb40347e4cc9f2

The following commit(s) were added to refs/heads/master by this push:
       new  34855d0   IDP-1432 Remove deprecated "api" methods
34855d0 is described below

commit 34855d05261196d1e16f4c3b1efb40347e4cc9f2
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Mar 26 16:20:56 2019 +0000

    IDP-1432 Remove deprecated "api" methods
    
    https://issues.shibboleth.net/jira/browse/IDP-1432
    
    There were entirely replaced by impl versions and left soley because of
    the version restrictions.
---
 .../idp/installer/PropertiesWithComments.java      | 240 -----------------
 .../ant/BasicKeystoreKeyStrategyTask.java          | 131 ---------
 .../idp/installer/ant/MergePropertiesTask.java     | 131 ---------
 .../idp/installer/ant/MetadataGeneratorTask.java   | 299 ---------------------
 .../idp/installer/ant/PasswordHandler.java         |  62 -----
 .../ant/SelfSignedCertificateGeneratorTask.java    | 174 ------------
 .../shibboleth/idp/installer/ant/package-info.java |  23 --
 7 files changed, 1060 deletions(-)

diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/PropertiesWithComments.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/PropertiesWithComments.java
deleted file mode 100644
index 2e84c6c..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/PropertiesWithComments.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.installer;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.annotation.Nonnull;
-
-import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-import net.shibboleth.utilities.java.support.primitive.StringSupport;
-
-/**
- * A package which is similar to Properties, but allows comments to be preserved. We use the Properties package to parse
- * the non-comment lines.
- */
- at Deprecated public class PropertiesWithComments {
-
-    /**
-     * The contents.
-     * 
-     * Each {@link Object} is either a string (a non-property line) or a {@link CommentedProperty}
-     * (an optionally commented property definition).
-     */
-    private List<Object> contents;
-
-    /** The properties bit. */
-    private Map<String, CommentedProperty> properties;
-
-    /**
-     * Add a property, either as a key/value pair or as a key/comment pair.
-     * 
-     * @param line what to look at
-     * @param isComment whether this is a comment or not.
-     * @throws IOException when badness happens.
-     */
-    protected void addCommentedProperty(@Nonnull @NotEmpty final String line, final boolean isComment)
-            throws IOException {
-        final Properties parser = new Properties();
-        final String modifiedLine;
-
-        if (isComment) {
-            modifiedLine = line.substring(1);
-        } else {
-            modifiedLine = line;
-        }
-
-        parser.load(new ByteArrayInputStream(modifiedLine.getBytes()));
-        if (!parser.isEmpty()) {
-            final String propName = StringSupport.trimOrNull(parser.stringPropertyNames().iterator().next());
-            if (propName != null) {
-                final CommentedProperty commentedProperty;
-
-                if (isComment) {
-                    commentedProperty = new CommentedProperty(propName, line, true);
-
-                } else {
-                    commentedProperty = new CommentedProperty(propName, parser.getProperty(propName), false);
-
-                }
-                properties.put(propName, commentedProperty);
-                contents.add(commentedProperty);
-            }
-        } else {
-            contents.add(line);
-        }
-        parser.clear();
-
-    }
-
-    /**
-     * Read the input stream into our structures.
-     * 
-     * @param input what to read
-     * @throws IOException if readline fails
-     */
-    public void load(final InputStream input) throws IOException {
-        DeprecationSupport.warn(ObjectType.CLASS, this.getClass().getName(), null , ".impl");
-        final BufferedReader reader = new BufferedReader(new InputStreamReader(input));
-        contents = new ArrayList<>();
-        properties = new HashMap<>();
-
-        String s = reader.readLine();
-
-        while (s != null) {
-            final String what = StringSupport.trimOrNull(s);
-            if (what == null) {
-                contents.add("");
-            } else if (what.startsWith("#")) {
-                if (what.contains("=")) {
-                    addCommentedProperty(s, true);
-                } else {
-                    contents.add(what);
-                }
-            } else {
-
-                addCommentedProperty(s, false);
-            }
-            s = reader.readLine();
-        }
-    }
-
-    /**
-     * Put the output to the supplied stream.
-     * 
-     * @param output where to write
-     * @throws IOException is the write fails
-     */
-    public void store(final OutputStream output) throws IOException {
-        final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output));
-
-        for (final Object o : contents) {
-            if (o instanceof String) {
-                writer.write((String) o);
-            } else if (o instanceof CommentedProperty) {
-                final CommentedProperty commentedProperty = (CommentedProperty) o;
-                commentedProperty.write(writer);
-            }
-            writer.newLine();
-        }
-        writer.flush();
-        writer.close();
-        output.close();
-    }
-
-    /**
-     * Replace the supplied property or stuff it at the bottom of the list.
-     * 
-     * @param propName the name of the property to replace
-     * @param newPropValue the value to replace
-     * @return true if the property was replaced false if it was added
-     */
-    public boolean replaceProperty(final String propName, final String newPropValue) {
-
-        CommentedProperty p = properties.get(propName);
-        if (null != p) {
-            p.setValue(newPropValue);
-            return true;
-        }
-        p = new CommentedProperty(propName, newPropValue, false);
-        contents.add(p);
-        properties.put(propName, p);
-        return false;
-    }
-
-    /**
-     * Append a comment to the list.
-     * 
-     * @param what what to add
-     */
-    public void addComment(final String what) {
-        contents.add("# " + what);
-    }
-
-    /**
-     * A POJO which looks like a property.
-     * 
-     * It may be a commented property from a line like this "#prop=value" or a property prop=value.
-     * 
-     */
-    protected class CommentedProperty {
-
-        /** The property name. */
-        private final String property;
-
-        /** The value - or the entire line if this is a comment. */
-        private String value;
-
-        /** Whether this is a comment or a value. */
-        private boolean isComment;
-
-        /**
-         * Constructor.
-         * 
-         * @param prop the property name.
-         * @param val the value or the entire line if this was a comment.
-         * @param comment whether this is a comment.
-         */
-        CommentedProperty(final String prop, final String val, final boolean comment) {
-            property = prop;
-            value = val;
-            isComment = comment;
-        }
-
-        /**
-         * Set a new value.
-         * 
-         * @param newValue what to set
-         */
-        protected void setValue(final String newValue) {
-            value = newValue;
-            isComment = false;
-        }
-
-        /**
-         * Write ourselves to the writer.
-         * 
-         * @param writer what to write with
-         * @throws IOException from the writer
-         */
-        protected void write(final BufferedWriter writer) throws IOException {
-
-            if (isComment) {
-                writer.write(value);
-            } else {
-                writer.write(property);
-                writer.write("= ");
-                writer.write(value);
-            }
-        }
-    }
-}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/BasicKeystoreKeyStrategyTask.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/BasicKeystoreKeyStrategyTask.java
deleted file mode 100644
index 8977ca1..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/BasicKeystoreKeyStrategyTask.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.installer.ant;
-
-import java.io.File;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
-import net.shibboleth.utilities.java.support.annotation.constraint.Positive;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-import net.shibboleth.utilities.java.support.security.BasicKeystoreKeyStrategyTool;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-
-/**
- * Wrapper around {@link BasicKeystoreKeyStrategyTool}.
- */
- at Deprecated public class BasicKeystoreKeyStrategyTask extends Task {
-
-    /** encapsulated {@link BasicKeystoreKeyStrategyTool}.*/
-    private BasicKeystoreKeyStrategyTool tool;
-    
-    /** Constructor. */
-    public BasicKeystoreKeyStrategyTask() {
-        tool = new BasicKeystoreKeyStrategyTool();
-    }
-    
-    /**
-     * Set the type of key that will be generated. Defaults to AES.
-     * 
-     * @param type type of key that will be generated
-     */
-    public void setKeyType(@Nonnull @NotEmpty final String type) {
-        tool.setKeyType(type);
-    } 
-
-    /**
-     * Set the size of the generated key. Defaults to 128
-     * 
-     * @param size size of the generated key
-     */
-    public void setKeySize(@Positive final int size) {
-        tool.setKeySize(size);
-    } 
-    
-    /**
-     * Set the encryption key alias base name.
-     * 
-     * @param alias the encryption key alias base
-     */
-    public void setKeyAlias(@Nonnull @NotEmpty final String alias) {
-        tool.setKeyAlias(alias);
-    } 
-
-    /**
-     * Set the number of keys to maintain. Defaults to 3.
-     * 
-     * @param count number of keys to maintain
-     */
-    public void setKeyCount(@Positive final int count) {
-        tool.setKeyCount(count);
-    } 
-
-    /**
-     * Set the type of keystore to create. Defaults to JCEKS.
-     * 
-     * @param type keystore type
-     */
-    public void setKeystoreType(@Nonnull @NotEmpty final String type) {
-        tool.setKeystoreType(type);
-    } 
-
-    /**
-     * Set the keystore file to create or modify.
-     * 
-     * @param file keystore file
-     */
-    public void setKeystoreFile(@Nonnull final File file) {
-        tool.setKeystoreFile(file);
-    } 
-
-    /**
-     * Set the password for the keystore.
-     * 
-     * @param password password for the keystore
-     */
-    public void setKeystorePassword(@Nullable final String password) {
-        tool.setKeystorePassword(password);
-    } 
-    
-    /**
-     * Set the key versioning file to create or modify.
-     * 
-     * @param file key versioning file
-     */
-    public void setVersionFile(@Nonnull final File file) {
-        tool.setVersionFile(file);
-    } 
-
-    /** {@inheritDoc} */
-    @Override
-    public void execute() {
-        DeprecationSupport.warn(ObjectType.CLASS, this.getClass().getName(), null , ".impl");
-        try {
-            tool.changeKey();
-        } catch (final Exception e) {
-            log("Build failed", e, Project.MSG_ERR);
-            throw new BuildException(e);
-        }
-    }
-}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/MergePropertiesTask.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/MergePropertiesTask.java
deleted file mode 100644
index 5b2d996..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/MergePropertiesTask.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.installer.ant;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Properties;
-
-import javax.annotation.Nonnull;
-
-import net.shibboleth.idp.installer.PropertiesWithComments;
-import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-
-/**
- * A class to merge a property file into another property file, preserving the comments. 
- */
- at Deprecated public class MergePropertiesTask extends Task {
-
-    /** The input file. */
-    private File inFile;
-    
-    /** The output file. */
-    private File outFile;
-
-    /** The merge file. */
-    private File mergeFile;
-    
-    /** Set the input file.
-     * @param what what to set
-     */
-    public void setInFile(@Nonnull final File what) {
-        inFile = Constraint.isNotNull(what, "Provided file must not be null");
-    }
-    
-    /** Set the output file.
-     * @param what what to set
-     */
-    public void setOutFile(@Nonnull final File what) {
-        outFile = Constraint.isNotNull(what, "Provided file must not be null");
-    }
-
-    /** Set the merge file.
-     * @param what what to set
-     */
-    public void setMergeFile(@Nonnull final File what) {
-        mergeFile = Constraint.isNotNull(what, "Provided file must not be null");
-    }
-
-    /** {@inheritDoc} */
-    // Checkstyle: CyclomaticComplexity OFF
-    @Override
-    public void execute() {
-        DeprecationSupport.warn(ObjectType.CLASS, this.getClass().getName(), null , ".impl");
-
-        if (null == inFile) {
-            log("Input file not provided", Project.MSG_ERR);
-            throw new BuildException("Non-existent input file");
-        }
-        if (!inFile.exists()) {
-            log("Input file " + inFile.getAbsolutePath() + " does not exist");
-            throw new BuildException("Non-existent input file");
-        }
-        if (null == outFile) {
-            log("Output file not provided, input taken", Project.MSG_INFO);
-        }
-        if (null == mergeFile) {
-            log("Merge file not provided", Project.MSG_ERR);
-            throw new BuildException("Non-existent input file");
-        }
-        if (!mergeFile.exists()) {
-            log("Input file " + mergeFile.getAbsolutePath() + " does not exist");
-            throw new BuildException("Non-existent merge file");
-        }
-        
-        final PropertiesWithComments in = new PropertiesWithComments(); 
-
-        try {
-            in.load(new FileInputStream(inFile));
-        } catch (final IOException e) {
-            log("Could not load input " + inFile.getAbsolutePath(), e, Project.MSG_ERR);
-            throw new BuildException(e);
-        }
-        
-        final Properties merge = new Properties(); 
-        try {
-            merge.load(new FileInputStream(mergeFile));
-        } catch (final IOException e) {
-            log("Could not load merge " + mergeFile.getAbsolutePath(), e, Project.MSG_ERR);
-            throw new BuildException(e);
-        }
-        
-        
-        for (final Object propName:merge.keySet()) {
-            if (propName instanceof String) {
-                final String name = (String) propName;
-                in.replaceProperty(name, merge.getProperty(name));
-            } 
-        }
-
-        try {
-            in.store(new FileOutputStream(outFile));
-        } catch (final IOException e) {
-            log("Could not store output " + outFile.getAbsolutePath(), e, Project.MSG_ERR);
-            throw new BuildException(e);
-        }
-    }
-    // Checkstyle: CyclomaticComplexity ON
-}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/MetadataGeneratorTask.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/MetadataGeneratorTask.java
deleted file mode 100644
index fbcab8a..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/MetadataGeneratorTask.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.installer.ant;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import net.shibboleth.ext.spring.util.ApplicationContextBuilder;
-import net.shibboleth.idp.installer.metadata.MetadataGenerator;
-import net.shibboleth.idp.installer.metadata.MetadataGeneratorParameters;
-import net.shibboleth.idp.spring.IdPPropertiesApplicationContextInitializer;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-
-/**
- * Task to generate metadata.
- */
- at Deprecated public class MetadataGeneratorTask extends Task {
-
-    /** Where we collect the parameters. */
-
-    /** where to put the data. */
-    private File outputFile;
-
-    /** Where idp.home is. */
-    @Nullable private String idpHome;
-
-    /** Ant level override for the encryption certificate. */
-    @Nullable private File encryptionCert;
-
-    /** Ant level override for the signing certificate. */
-    @Nullable private File signingCert;
-
-    /** Ant level override for the back channel certificate. */
-    @Nullable private File backchannelCert;
-
-    /** Ant level override for the entity ID. */
-    @Nullable private String entityID;
-
-    /** Ant level override for the DNS name. */
-    @Nullable private String dnsName;
-
-    /** Ant level override for the scope. */
-    @Nullable private String scope;
-
-    /**
-     * Whether to comment out the SAML2 AA port.
-     */
-    private boolean saml2AttributeQueryCommented = true;
-
-    /**
-     * Whether to comment out the SAML2 SLO endpoints.
-     */
-    private boolean saml2LogoutCommented = true;
-
-    /**
-     * Where is idp.home.
-     * 
-     * @return Returns idpHome.
-     */
-    @Nullable public String getIdpHome() {
-        return idpHome;
-    }
-
-    /**
-     * Set where where is idp.home.
-     * 
-     * @param home The idpHome to set.
-     */
-    public void setIdpHome(@Nullable final String home) {
-        idpHome = home;
-    }
-
-    /**
-     * Set the output file.
-     * 
-     * @param file what to set.
-     */
-    public void setOutput(final File file) {
-
-        outputFile = file;
-    }
-
-    /**
-     * Set the encryption Certificate file. Overrides the Spring definition.
-     * 
-     * @param file what to set.
-     */
-    public void setEncryptionCert(final File file) {
-        encryptionCert = file;
-    }
-
-    /**
-     * Set the signing Certificate file. Overrides the Spring definition.
-     * 
-     * @param file what to set.
-     */
-    public void setSigningCert(final File file) {
-        signingCert = file;
-    }
-
-    /**
-     * Set the Backchannel Certificate file.
-     * 
-     * @param file what to set.
-     */
-    public void setBackchannelCert(final File file) {
-        backchannelCert = file;
-    }
-
-    /**
-     * Sets the entityID. Overrides the Spring definition.
-     * 
-     * @param id what to set.
-     */
-    public void setEntityID(final String id) {
-        entityID = id;
-    }
-
-    /**
-     * Sets the dns name.
-     * 
-     * @param name what to set.
-     */
-    public void setDnsName(final String name) {
-        dnsName = name;
-    }
-
-    /**
-     * Sets the scope. Overrides the Spring definition.
-     * 
-     * @param value what to set.
-     */
-    public void setScope(final String value) {
-        scope = value;
-    }
-
-    /**
-     * Returns whether to comment the SAML2 AA endpoint.
-     * 
-     * @return Returns when to comment the SAML2 AA endpoint.
-     */
-    public boolean isSAML2AttributeQueryCommented() {
-        return saml2AttributeQueryCommented;
-    }
-
-    /**
-     * Sets whether to comment the SAML2 AA endpoint.
-     * 
-     * @param asComment whether to comment or not.
-     */
-    public void setSAML2AttributeQueryCommented(final boolean asComment) {
-        saml2AttributeQueryCommented = asComment;
-    }
-
-    /**
-     * Returns whether to comment the SAML2 Logout endpoints.
-     * 
-     * @return whether to comment the SAML2 Logout endpoints
-     */
-    public boolean isSAML2LogoutCommented() {
-        return saml2LogoutCommented;
-    }
-
-    /**
-     * Sets whether to comment the SAML2 Logout endpoints.
-     * 
-     * @param asComment whether to comment or not
-     */
-    public void setSAML2LogoutCommented(final boolean asComment) {
-        saml2LogoutCommented = asComment;
-    }
-
-    /** {@inheritDoc} */
-    // Checkstyle: CyclomaticComplexity OFF
-    @Override public void execute() {
-        DeprecationSupport.warn(ObjectType.CLASS, this.getClass().getName(), null , ".impl");
-
-        try {
-            final MetadataGeneratorParameters parameters;
-
-            final Resource resource = new ClassPathResource("net/shibboleth/idp/installer/metadata-generator.xml");
-
-            final GenericApplicationContext context = new ApplicationContextBuilder()
-                    .setName(MetadataGeneratorTask.class.getName())
-                    .setServiceConfigurations(Collections.singletonList(resource))
-                    .setContextInitializer(new Initializer())
-                    .build();
-            
-            parameters = context.getBean("IdPConfiguration", MetadataGeneratorParameters.class);
-
-            if (encryptionCert != null) {
-                parameters.setEncryptionCert(encryptionCert);
-            }
-            if (signingCert != null) {
-                parameters.setSigningCert(signingCert);
-            }
-            if (backchannelCert != null) {
-                parameters.setBackchannelCert(backchannelCert);
-            }
-
-            final MetadataGenerator generator = new MetadataGenerator(outputFile);
-            final List<List<String>> signing = new ArrayList<>(2);
-            List<String> value = parameters.getBackchannelCert();
-            // IDP-1233 Note that MetadataGenerator.WriteKeyDescriptors() assumes that the order is backchannel, signing
-            if (null != value) {
-                signing.add(value);
-            }
-            value = parameters.getSigningCert();
-            if (null != value) {
-                signing.add(value);
-            }
-            generator.setSigningCerts(signing);
-            value = parameters.getEncryptionCert();
-            if (null != value) {
-                generator.setEncryptionCerts(Collections.singletonList(value));
-            }
-            if (dnsName != null) {
-                generator.setDNSName(dnsName);
-            } else {
-                generator.setDNSName(parameters.getDnsName());
-            }
-            if (entityID != null) {
-                generator.setEntityID(entityID);
-            } else {
-                generator.setEntityID(parameters.getEntityID());
-            }
-            if (scope != null) {
-                generator.setScope(scope);
-            } else {
-                generator.setScope(parameters.getScope());
-            }
-            generator.setSAML2AttributeQueryCommented(isSAML2AttributeQueryCommented());
-            generator.setSAML2LogoutCommented(isSAML2LogoutCommented());
-            generator.generate();
-
-        } catch (final Exception e) {
-            log("Build failed", e, Project.MSG_ERR);
-            throw new BuildException(e);
-        }
-    }
-
-    // Checkstyle: CyclomaticComplexity ON
-
-    /**
-     * An initializer which knows about our idp.home.
-     * 
-     */
-    public class Initializer extends IdPPropertiesApplicationContextInitializer {
-
-        /** {@inheritDoc} */
-        @Override @Nonnull public String[] selectSearchLocations(
-                @Nonnull final ConfigurableApplicationContext applicationContext) {
-            if (null == idpHome) {
-                return super.selectSearchLocations(applicationContext);
-            }
-            final String[] result = {idpHome};
-            return result;
-        }
-
-        /** {@inheritDoc} */
-        @Override @Nonnull public String[] getSearchLocations() {
-            if (null == idpHome) {
-                return super.getSearchLocations();
-            }
-            final String[] result = {idpHome};
-            return result;
-        }
-
-    }
-}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/PasswordHandler.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/PasswordHandler.java
deleted file mode 100644
index 63ecc5a..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/PasswordHandler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.installer.ant;
-
-import org.apache.tools.ant.input.InputRequest;
-import org.apache.tools.ant.input.SecureInputHandler;
-
-/** Ant helper class to ask for passwords, rejecting zero length passwords and asking for confirmation. */
- at Deprecated public class PasswordHandler extends SecureInputHandler {
-    
-    /**
-     * Constructor.
-     *
-     */
-    public PasswordHandler() {
-        System.console().printf("Calling Deprecated class " + this.getClass().getName() + "\n");
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void handleInput(final InputRequest arg0) {
-        while (true) {
-            System.console().printf("%s", arg0.getPrompt());
-            System.console().flush();
-            char[] result  = System.console().readPassword();
-            if (null == result || result.length == 0) {
-                System.console().printf("Password cannot be zero length\n");
-                continue;
-            }
-            final String firstPass = String.copyValueOf(result);
-            System.console().printf("Re-enter password: ");
-            System.console().flush();
-            result  = System.console().readPassword();
-            if (null == result || result.length == 0) {
-                System.console().printf("Password cannot be zero length\n");
-                continue;
-            }
-            final String secondPass = String.copyValueOf(result);
-            if (firstPass.equals(secondPass)) {
-                arg0.setInput(firstPass);
-                return;
-            }
-            System.console().printf("Passwords did not match\n");
-        }
-    }
-    
-}
\ No newline at end of file
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/SelfSignedCertificateGeneratorTask.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/SelfSignedCertificateGeneratorTask.java
deleted file mode 100644
index 0e287c7..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/SelfSignedCertificateGeneratorTask.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.installer.ant;
-
-import java.io.File;
-import java.util.List;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
-import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
-import net.shibboleth.utilities.java.support.annotation.constraint.Positive;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.StringSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-import net.shibboleth.utilities.java.support.security.SelfSignedCertificateGenerator;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-
-/**
- * Task to shim around {@link SelfSignedCertificateGenerator}.
- */
- at Deprecated public class SelfSignedCertificateGeneratorTask extends Task {
-
-    /** Our wrapped {@link SelfSignedCertificateGenerator}. */
-    private SelfSignedCertificateGenerator generator;
-
-    /**
-     * Constructor.
-     */
-    public SelfSignedCertificateGeneratorTask() {
-        generator = new SelfSignedCertificateGenerator();
-    }
-
-    /**
-     * Set the type of key that will be generated. Defaults to RSA.
-     * 
-     * @param type type of key that will be generated
-     */
-    public void setKeyType(@Nonnull @NotEmpty final String type) {
-        generator.setKeyType(type);
-    }
-
-    /**
-     * Set the size of the generated key. Defaults to 2048
-     * 
-     * @param size size of the generated key
-     */
-    public void setKeySize(@Positive final int size) {
-        generator.setKeySize(size);
-    }
-
-    /**
-     * Set the number of years for which the certificate will be valid.
-     * 
-     * @param lifetime number of years for which the certificate will be valid
-     */
-    public void setCertificateLifetime(@Positive final int lifetime) {
-        generator.setCertificateLifetime(lifetime);
-    }
-
-    /**
-     * Set the certificate algorithm that will be used. Defaults to SHA256withRSA.
-     * 
-     * @param alg certificate algorithm
-     */
-    public void setCertificateAlg(@Nonnull @NotEmpty final String alg) {
-        generator.setCertificateAlg(alg);
-    }
-
-    /**
-     * Set the hostname that will appear in the certificate's DN.
-     * 
-     * @param name hostname that will appear in the certificate's DN
-     */
-    public void setHostName(@Nonnull @NotEmpty final String name) {
-        generator.setHostName(name);
-    }
-
-    /**
-     * Set the file to which the private key will be written.
-     * 
-     * @param file file to which the private key will be written
-     */
-    public void setPrivateKeyFile(@Nullable final File file) {
-        generator.setPrivateKeyFile(file);
-    }
-
-    /**
-     * Set the file to which the certificate will be written.
-     * 
-     * @param file file to which the certificate will be written
-     */
-    public void setCertificateFile(@Nullable final File file) {
-        generator.setCertificateFile(file);
-    }
-
-    /**
-     * Set the type of keystore to create.
-     * 
-     * @param type keystore type
-     */
-    public void setKeystoreType(@Nonnull @NotEmpty final String type) {
-        generator.setKeystoreType(type);
-    }
-
-    /**
-     * Set the file to which the keystore will be written.
-     * 
-     * @param file file to which the keystore will be written
-     */
-    public void setKeystoreFile(@Nullable final File file) {
-        generator.setKeystoreFile(file);
-    }
-
-    /**
-     * Set the password for the generated keystore.
-     * 
-     * @param password password for the generated keystore
-     */
-    public void setKeystorePassword(@Nullable final String password) {
-        generator.setKeystorePassword(password);
-    }
-
-    /**
-     * Set the optional DNS subject alt names.
-     * 
-     * @param altNames collection of subject alt names.
-     */
-    public void setDNSSubjectAltNames(@Nonnull @NonnullElements final String altNames) {
-        final List<String> nameList = StringSupport.stringToList(altNames, " ");
-        generator.setDNSSubjectAltNames(nameList);
-    }
-
-    /**
-     * Set the optional URI subject alt names.
-     * 
-     * @param subjectAltNames collection of subject alt names.
-     */
-    public void setURISubjectAltNames(@Nonnull @NonnullElements final String subjectAltNames) {
-        final List<String> nameList = StringSupport.stringToList(subjectAltNames, " ");
-        generator.setURISubjectAltNames(nameList);
-    }
-
-    @Override 
-    /** {@inheritDoc} */
-    public void execute() {
-        DeprecationSupport.warn(ObjectType.CLASS, this.getClass().getName(), null , ".impl");
-        try {
-            generator.generate();
-        } catch (final Exception e) {
-            log("Build failed", e, Project.MSG_ERR);
-            throw new BuildException(e);
-        }
-    }
-}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/package-info.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/package-info.java
deleted file mode 100644
index d40bdd6..0000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * OLD, DEPRECATED Targets for Ant.
- * Use the .impl versions
- */
-
-package net.shibboleth.idp.installer.ant;
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list