Package org.apache.sshd.common.mac
Enum BuiltinMacs
- All Implemented Interfaces:
Serializable,Comparable<BuiltinMacs>,Supplier<Mac>,AlgorithmNameProvider,BuiltinFactory<Mac>,Factory<Mac>,MacFactory,MacInformation,NamedFactory<Mac>,NamedResource,OptionalFeature
Provides easy access to the currently implemented macs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final intprivate final intprivate static final Map<String, MacFactory> private final Stringstatic final Set<BuiltinMacs> Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTORFields inherited from interface org.apache.sshd.common.OptionalFeature
FALSE, TRUE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBuiltinMacs(String factoryName, String algorithm, int bsize, int defbsize) -
Method Summary
Modifier and TypeMethodDescriptioncreate()static BuiltinMacsfromFactory(NamedFactory<Mac> factory) static BuiltinMacsfromFactoryName(String name) static BuiltinMacsfromString(String s) final Stringfinal intfinal intfinal StringgetName()static NavigableSet<MacFactory> final booleanstatic BuiltinMacs.ParseResultparseMacsList(String macs) static BuiltinMacs.ParseResultparseMacsList(String... macs) static BuiltinMacs.ParseResultparseMacsList(Collection<String> macs) static voidregisterExtension(MacFactory extension) Registered aNamedFactoryto be available besides the built-in ones when parsing configurationstatic MacFactoryresolveFactory(String name) final StringtoString()static MacFactoryunregisterExtension(String name) Unregisters specified extensionstatic BuiltinMacsReturns the enum constant of this type with the specified name.static BuiltinMacs[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfMethods inherited from interface org.apache.sshd.common.mac.MacInformation
isEncryptThenMac
-
Enum Constant Details
-
Field Details
-
VALUES
-
EXTENSIONS
-
factoryName
-
algorithm
-
defbsize
private final int defbsize -
bsize
private final int bsize
-
-
Constructor Details
-
BuiltinMacs
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
create
-
getName
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-
getAlgorithm
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-
getBlockSize
public final int getBlockSize()- Specified by:
getBlockSizein interfaceMacInformation- Returns:
- MAC output block size in bytes - may be less than the default - e.g., MD5-96
-
getDefaultBlockSize
public final int getDefaultBlockSize()- Specified by:
getDefaultBlockSizein interfaceMacInformation- Returns:
- The "natural" MAC block size in bytes
-
isSupported
public final boolean isSupported()- Specified by:
isSupportedin interfaceOptionalFeature
-
toString
- Overrides:
toStringin classEnum<BuiltinMacs>
-
registerExtension
Registered aNamedFactoryto be available besides the built-in ones when parsing configuration- Parameters:
extension- The factory to register- Throws:
IllegalArgumentException- if factory instance isnull, or overrides a built-in one or overrides another registered factory with the same name (case insensitive).
-
getRegisteredExtensions
- Returns:
- A
NavigableSetof the currently registered extensions, sorted according to the factory name (case insensitive)
-
unregisterExtension
Unregisters specified extension- Parameters:
name- The factory name - ignored ifnull/empty- Returns:
- The registered extension -
nullif not found
-
fromString
- Parameters:
s- TheEnum's name - ignored ifnull/empty- Returns:
- The matching
BuiltinMacswhoseEnum.name()matches (case insensitive) the provided argument -nullif no match
-
fromFactory
- Parameters:
factory- TheNamedFactoryfor the MAC - ignored ifnull- Returns:
- The matching
BuiltinMacswhose factory name matches (case insensitive) the digest factory name - See Also:
-
fromFactoryName
- Parameters:
name- The factory name - ignored ifnull/empty- Returns:
- The matching
BuiltinMacswhose factory name matches (case insensitive) the provided name -nullif no match
-
parseMacsList
- Parameters:
macs- A comma-separated list of MACs' names - ignored ifnull/empty- Returns:
- A
BuiltinMacs.ParseResultcontaining the successfully parsed factories and the unknown ones. Note: it is up to caller to ensure that the lists do not contain duplicates
-
parseMacsList
-
parseMacsList
-
resolveFactory
- Parameters:
name- The factory name- Returns:
- The factory or
nullif it is neither a built-in one or a registered extension
-