public final class SshConfigFileReader extends Object
Modifier and Type | Method and Description |
---|---|
static <M extends AbstractFactoryManager> |
configure(M manager,
PropertyResolver props,
boolean lenient,
boolean ignoreUnsupported)
Configures an
AbstractFactoryManager with the values read from
some configuration. |
static <M extends AbstractFactoryManager> |
configureCiphers(M manager,
PropertyResolver props,
boolean lenient,
boolean ignoreUnsupported) |
static <M extends AbstractFactoryManager> |
configureCiphers(M manager,
String value,
boolean lenient,
boolean ignoreUnsupported) |
static <M extends AbstractFactoryManager> |
configureCompression(M manager,
PropertyResolver props,
boolean lenient,
boolean ignoreUnsupported)
Configure the factory manager using one of the known
CompressionConfigValue s. |
static <M extends AbstractFactoryManager> |
configureCompression(M manager,
String value,
boolean lenient,
boolean ignoreUnsupported) |
static <M extends AbstractFactoryManager> |
configureKeyExchanges(M manager,
PropertyResolver props,
boolean lenient,
Function<? super DHFactory,? extends NamedFactory<KeyExchange>> xformer,
boolean ignoreUnsupported) |
static <M extends AbstractFactoryManager> |
configureKeyExchanges(M manager,
String value,
boolean lenient,
Function<? super DHFactory,? extends NamedFactory<KeyExchange>> xformer,
boolean ignoreUnsupported) |
static <M extends AbstractFactoryManager> |
configureMacs(M manager,
PropertyResolver resolver,
boolean lenient,
boolean ignoreUnsupported) |
static <M extends AbstractFactoryManager> |
configureMacs(M manager,
String value,
boolean lenient,
boolean ignoreUnsupported) |
static <M extends AbstractFactoryManager> |
configureSignatures(M manager,
PropertyResolver props,
boolean lenient,
boolean ignoreUnsupported) |
static <M extends AbstractFactoryManager> |
configureSignatures(M manager,
String value,
boolean lenient,
boolean ignoreUnsupported) |
static BuiltinCiphers.ParseResult |
getCiphers(PropertyResolver props) |
static CompressionFactory |
getCompression(PropertyResolver props) |
static BuiltinDHFactories.ParseResult |
getKexFactories(PropertyResolver props) |
static BuiltinMacs.ParseResult |
getMacs(PropertyResolver props) |
static BuiltinSignatures.ParseResult |
getSignatures(PropertyResolver props) |
public static BuiltinCiphers.ParseResult getCiphers(PropertyResolver props)
props
- The PropertyResolver
- ignored if null
/emptyParseResult
of all the NamedFactory
-ies
whose name appears in the string and represent a built-in cipher.
Any unknown name is ignored. The order of the returned result
is the same as the original order - bar the unknown ciphers.
Note: it is up to caller to ensure that the lists do not
contain duplicatesCIPHERS_CONFIG_PROP
,
BuiltinCiphers.parseCiphersList(String)
public static BuiltinMacs.ParseResult getMacs(PropertyResolver props)
props
- The PropertyResolver
- ignored if null
/emptyParseResult
of all the NamedFactory
-ies
whose name appears in the string and represent a built-in MAC. Any
unknown name is ignored. The order of the returned result
is the same as the original order - bar the unknown MACs.
Note: it is up to caller to ensure that the list does not
contain duplicatesMACS_CONFIG_PROP
,
BuiltinMacs.parseMacsList(String)
public static BuiltinSignatures.ParseResult getSignatures(PropertyResolver props)
props
- The PropertyResolver
- ignored if null
/emptyParseResult
of all the NamedFactory
whose name appears in the string and represent a built-in signature. Any
unknown name is ignored. The order of the returned result is the
same as the original order - bar the unknown signatures. Note: it
is up to caller to ensure that the list does not contain duplicatesHOST_KEY_ALGORITHMS_CONFIG_PROP
,
BuiltinSignatures.parseSignatureList(String)
public static BuiltinDHFactories.ParseResult getKexFactories(PropertyResolver props)
props
- The PropertyResolver
- ignored if null
/emptyParseResult
of all the DHFactory
-ies
whose name appears in the string and represent a built-in value. Any
unknown name is ignored. The order of the returned result is the
same as the original order - bar the unknown ones. Note: it is
up to caller to ensure that the list does not contain duplicatesKEX_ALGORITHMS_CONFIG_PROP
,
BuiltinDHFactories.parseDHFactoriesList(String)
public static CompressionFactory getCompression(PropertyResolver props)
props
- The PropertyResolver
- ignored if null
/emptyNamedFactory
for the configured value.
null
if no configuration or unknown name specifiedCOMPRESSION_PROP
public static <M extends AbstractFactoryManager> M configure(M manager, PropertyResolver props, boolean lenient, boolean ignoreUnsupported)
Configures an AbstractFactoryManager
with the values read from
some configuration. Currently it configures:
Cipher
s - via the ConfigFileReaderSupport.CIPHERS_CONFIG_PROP
Mac
s - via the ConfigFileReaderSupport.MACS_CONFIG_PROP
Signature
s - via the ConfigFileReaderSupport.HOST_KEY_ALGORITHMS_CONFIG_PROP
Compression
- via the ConfigFileReaderSupport.COMPRESSION_PROP
M
- The generic factory managermanager
- The AbstractFactoryManager
to configureprops
- The PropertyResolver
to use for configuration - Note:
if any known configuration value has a default and does not appear in the
properties, the default is usedlenient
- If true
then any unknown configuration values are ignored.
Otherwise an IllegalArgumentException
is thrownignoreUnsupported
- filter out unsupported configuration values (e.g., ciphers,
key exchanges, etc..). Note: if after filtering out all the unknown
or unsupported values there is an empty configuration exception is thrownpublic static <M extends AbstractFactoryManager> M configureCiphers(M manager, PropertyResolver props, boolean lenient, boolean ignoreUnsupported)
public static <M extends AbstractFactoryManager> M configureCiphers(M manager, String value, boolean lenient, boolean ignoreUnsupported)
public static <M extends AbstractFactoryManager> M configureSignatures(M manager, PropertyResolver props, boolean lenient, boolean ignoreUnsupported)
public static <M extends AbstractFactoryManager> M configureSignatures(M manager, String value, boolean lenient, boolean ignoreUnsupported)
public static <M extends AbstractFactoryManager> M configureMacs(M manager, PropertyResolver resolver, boolean lenient, boolean ignoreUnsupported)
public static <M extends AbstractFactoryManager> M configureMacs(M manager, String value, boolean lenient, boolean ignoreUnsupported)
public static <M extends AbstractFactoryManager> M configureKeyExchanges(M manager, PropertyResolver props, boolean lenient, Function<? super DHFactory,? extends NamedFactory<KeyExchange>> xformer, boolean ignoreUnsupported)
M
- The generic factory managermanager
- The AbstractFactoryManager
to set up (may not be null
)props
- The (non-null
) PropertyResolver
containing the configurationlenient
- If true
then any unknown/unsupported configuration
values are ignored. Otherwise an IllegalArgumentException
is thrownxformer
- A Function
to convert the configured DHFactory
-ies
to NamedFactory
-ies of KeyExchange
ignoreUnsupported
- Filter out any un-supported configurations - Note:
if after ignoring the unknown and un-supported values the result is an empty
list of factories and exception is thrownKEX_ALGORITHMS_CONFIG_PROP
,
DEFAULT_KEX_ALGORITHMS
public static <M extends AbstractFactoryManager> M configureKeyExchanges(M manager, String value, boolean lenient, Function<? super DHFactory,? extends NamedFactory<KeyExchange>> xformer, boolean ignoreUnsupported)
public static <M extends AbstractFactoryManager> M configureCompression(M manager, PropertyResolver props, boolean lenient, boolean ignoreUnsupported)
CompressionConfigValue
s.M
- The generic factory managermanager
- The AbstractFactoryManager
to configureprops
- The configuration Properties
lenient
- If true
and an unknown value is provided then
it is ignoredignoreUnsupported
- If false
then check if the compression
is currently supported before setting itpublic static <M extends AbstractFactoryManager> M configureCompression(M manager, String value, boolean lenient, boolean ignoreUnsupported)
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.