All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.schmizz.sshj.Config Maven / Gradle / Ivy

/*
 * Copyright 2010-2012 sshj contributors
 *
 * Licensed 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.schmizz.sshj;

import net.schmizz.sshj.common.Factory;
import net.schmizz.sshj.signature.Signature;
import net.schmizz.sshj.transport.cipher.Cipher;
import net.schmizz.sshj.transport.compression.Compression;
import net.schmizz.sshj.transport.kex.KeyExchange;
import net.schmizz.sshj.transport.mac.MAC;
import net.schmizz.sshj.transport.random.Random;
import net.schmizz.sshj.userauth.keyprovider.FileKeyProvider;

import java.util.List;

/**
 * Holds configuration information and factories. Acts a container for factories of {@link KeyExchange}, {@link Cipher},
 * {@link Compression}, {@link MAC}, {@link Signature}, {@link Random}, and {@link FileKeyProvider}.
 */
public interface Config {

    /**
     * Retrieve the list of named factories for {@code Cipher}.
     *
     * @return a list of named {@code Cipher} factories
     */
    List> getCipherFactories();

    /**
     * Retrieve the list of named factories for {@code Compression}.
     *
     * @return a list of named {@code Compression} factories
     */
    List> getCompressionFactories();

    /**
     * Retrieve the list of named factories for {@code FileKeyProvider}.
     *
     * @return a list of named {@code FileKeyProvider} factories
     */
    List> getFileKeyProviderFactories();

    /**
     * Retrieve the list of named factories for {@code KeyExchange}.
     *
     * @return a list of named {@code KeyExchange} factories
     */
    List> getKeyExchangeFactories();

    /**
     * Retrieve the list of named factories for {@code MAC}.
     *
     * @return a list of named {@code MAC} factories
     */
    List> getMACFactories();

    /**
     * Retrieve the {@link Random} factory.
     *
     * @return the {@link Random} factory
     */
    Factory getRandomFactory();

    /**
     * Retrieve the list of named factories for {@link Signature}
     *
     * @return a list of named {@link Signature} factories
     */
    List> getSignatureFactories();

    /**
     * Returns the software version information for identification during SSH connection initialization. For example,
     * {@code "NET_3_0"}.
     */
    String getVersion();

    /**
     * Set the named factories for {@link Cipher}.
     *
     * @param cipherFactories a list of named factories
     */
    void setCipherFactories(List> cipherFactories);

    /**
     * Set the named factories for {@link Compression}.
     *
     * @param compressionFactories a list of named factories
     */
    void setCompressionFactories(List> compressionFactories);

    /**
     * Set the named factories for {@link FileKeyProvider}.
     *
     * @param fileKeyProviderFactories a list of named factories
     */
    void setFileKeyProviderFactories(List> fileKeyProviderFactories);

    /**
     * Set the named factories for {@link KeyExchange}.
     *
     * @param kexFactories a list of named factories
     */
    void setKeyExchangeFactories(List> kexFactories);

    /**
     * Set the named factories for {@link MAC}.
     *
     * @param macFactories a list of named factories
     */
    void setMACFactories(List> macFactories);

    /**
     * Set the factory for {@link Random}.
     *
     * @param randomFactory the factory
     */
    void setRandomFactory(Factory randomFactory);

    /**
     * Set the named factories for {@link Signature}.
     *
     * @param signatureFactories a list of named factories
     */
    void setSignatureFactories(List> signatureFactories);

    /**
     * Set the software version information for identification during SSH connection initialization. For example, {@code
     * "SSHJ_0_1"}.
     *
     * @param version software version info
     */
    void setVersion(String version);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy