Top Description Inners Fields Constructors Methods
org.apache.sshd.common.mac

public sealed Enum BuiltinMacs

extends Enum<BuiltinMacs>
implements MacFactory
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.mac.MacFactory, org.apache.sshd.common.BuiltinFactory, org.apache.sshd.common.OptionalFeature, org.apache.sshd.common.NamedFactory, org.apache.sshd.common.NamedResource, org.apache.sshd.common.Factory, java.util.function.Supplier, org.apache.sshd.common.mac.MacInformation, org.apache.sshd.common.AlgorithmNameProvider
Imports
java.util.ArrayList, .Arrays, .Collection, .Collections, .EnumSet, .List, .Map, .NavigableSet, .Objects, .Set, .TreeMap, org.apache.sshd.common.NamedFactory, .NamedResource, org.apache.sshd.common.config.NamedFactoriesListParseResult, org.apache.sshd.common.util.GenericUtils, .ValidateUtils

Provides easy access to the currently implemented macs
Author
Apache MINA SSHD Project

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

Modifier and TypeField and Description
private final String
private final int
private final int
private static final Map<String, MacFactory>
private final String
public static final BuiltinMacs
hmacmd5

Deprecated
public static final BuiltinMacs
hmacmd596

Deprecated
public static final BuiltinMacs
public static final BuiltinMacs
hmacsha196

Deprecated
public static final BuiltinMacs
public static final BuiltinMacs
public static final BuiltinMacs
public static final BuiltinMacs
public static final BuiltinMacs
public static final Set<BuiltinMacs>

Constructor Summary

AccessConstructor and Description
private
BuiltinMacs(String factoryName, String algorithm, int bsize, int defbsize)

Method Summary

Modifier and TypeMethod and Description
public Mac
public static BuiltinMacs

Returns:

The matching org.apache.sshd.common.mac.BuiltinMacs whose factory name matches (case insensitive) the digest factory name
fromFactory
(NamedFactory<Mac>
The org.apache.sshd.common.NamedFactory for the MAC - ignored if null
factory
)

public static BuiltinMacs

Returns:

The matching BuiltinMacs whose factory name matches (case insensitive) the provided name - null if no match
fromFactoryName
(String
The factory name - ignored if null/empty
name
)

public static BuiltinMacs

Returns:

The matching org.apache.sshd.common.mac.BuiltinMacs whose Enum#name() matches (case insensitive) the provided argument - null if no match
fromString
(String
The Enum's name - ignored if null/empty
s
)

public final String
public final int
public final int
public final String
public static NavigableSet<MacFactory>

Returns:

A NavigableSet of the currently registered extensions, sorted according to the factory name (case insensitive)
getRegisteredExtensions
()

public final boolean
public static BuiltinMacs.ParseResult

Returns:

A ParseResult containing the successfully parsed factories and the unknown ones

Note

it is up to caller to ensure that the lists do not contain duplicates

parseMacsList
(String
A comma-separated list of MACs' names - ignored if null/empty
macs
)

public static BuiltinMacs.ParseResult
public static BuiltinMacs.ParseResult
public static void
registerExtension(MacFactory
The factory to register
extension
)

Registered a NamedFactory to be available besides the built-in ones when parsing configuration

public static MacFactory

Returns:

The factory or null if it is neither a built-in one or a registered extension
resolveFactory
(String
The factory name
name
)

public final String
toString()

Overrides java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration.

public static MacFactory

Returns:

The registered extension - null if not found
unregisterExtension
(String
The factory name - ignored if null/empty
name
)

Unregisters specified extension

public static BuiltinMacs
public static BuiltinMacs[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinalvalueOf

Field Detail

algorithmback to summary
private final String algorithm
bsizeback to summary
private final int bsize
defbsizeback to summary
private final int defbsize
EXTENSIONSback to summary
private static final Map<String, MacFactory> EXTENSIONS
factoryNameback to summary
private final String factoryName
hmacmd5back to summary
public static final BuiltinMacs hmacmd5

Deprecated

Annotations
@Deprecated
See Also
SSHD-1004
hmacmd596back to summary
public static final BuiltinMacs hmacmd596

Deprecated

Annotations
@Deprecated
See Also
SSHD-1004
hmacsha1back to summary
public static final BuiltinMacs hmacsha1
hmacsha196back to summary
public static final BuiltinMacs hmacsha196

Deprecated

Annotations
@Deprecated
See Also
SSHD-1004
hmacsha1etmback to summary
public static final BuiltinMacs hmacsha1etm
hmacsha256back to summary
public static final BuiltinMacs hmacsha256

See RFC 6668

hmacsha256etmback to summary
public static final BuiltinMacs hmacsha256etm
hmacsha512back to summary
public static final BuiltinMacs hmacsha512

See RFC 6668

hmacsha512etmback to summary
public static final BuiltinMacs hmacsha512etm
VALUESback to summary
public static final Set<BuiltinMacs> VALUES

Constructor Detail

BuiltinMacsback to summary
private BuiltinMacs(String factoryName, String algorithm, int bsize, int defbsize)

Method Detail

createback to summary
public Mac create()

Implements org.apache.sshd.common.Factory.create.

Returns:Mac

Doc from org.apache.sshd.common.Factory.create.

A new instance

Annotations
@Override
fromFactoryback to summary
public static BuiltinMacs fromFactory(NamedFactory<Mac> factory)
Parameters
factory:NamedFactory<Mac>

The org.apache.sshd.common.NamedFactory for the MAC - ignored if null

Returns:BuiltinMacs

The matching org.apache.sshd.common.mac.BuiltinMacs whose factory name matches (case insensitive) the digest factory name

See Also
fromFactoryName(String)
fromFactoryNameback to summary
public static BuiltinMacs fromFactoryName(String name)
Parameters
name:String

The factory name - ignored if null/empty

Returns:BuiltinMacs

The matching BuiltinMacs whose factory name matches (case insensitive) the provided name - null if no match

fromStringback to summary
public static BuiltinMacs fromString(String s)
Parameters
s:String

The Enum's name - ignored if null/empty

Returns:BuiltinMacs

The matching org.apache.sshd.common.mac.BuiltinMacs whose Enum#name() matches (case insensitive) the provided argument - null if no match

getAlgorithmback to summary
public final String getAlgorithm()

Implements org.apache.sshd.common.AlgorithmNameProvider.getAlgorithm.

Annotations
@Override
getBlockSizeback to summary
public final int getBlockSize()

Implements org.apache.sshd.common.mac.MacInformation.getBlockSize.

Returns:int

Doc from org.apache.sshd.common.mac.MacInformation.getBlockSize.

MAC output block size in bytes - may be less than the default - e.g., MD5-96

Annotations
@Override
getDefaultBlockSizeback to summary
public final int getDefaultBlockSize()

Implements org.apache.sshd.common.mac.MacInformation.getDefaultBlockSize.

Returns:int

Doc from org.apache.sshd.common.mac.MacInformation.getDefaultBlockSize.

The "natural" MAC block size in bytes

Annotations
@Override
getNameback to summary
public final String getName()

Implements org.apache.sshd.common.NamedResource.getName.

Returns:String

Doc from org.apache.sshd.common.NamedResource.getName.

The resource name

Annotations
@Override
getRegisteredExtensionsback to summary
public static NavigableSet<MacFactory> getRegisteredExtensions()
Returns:NavigableSet<MacFactory>

A NavigableSet of the currently registered extensions, sorted according to the factory name (case insensitive)

isSupportedback to summary
public final boolean isSupported()

Implements org.apache.sshd.common.OptionalFeature.isSupported.

Annotations
@Override
parseMacsListback to summary
public static BuiltinMacs.ParseResult parseMacsList(String macs)
Parameters
macs:String

A comma-separated list of MACs' names - ignored if null/empty

Returns:BuiltinMacs.ParseResult

A ParseResult containing the successfully parsed factories and the unknown ones

Note

it is up to caller to ensure that the lists do not contain duplicates

parseMacsListback to summary
public static BuiltinMacs.ParseResult parseMacsList(String... macs)
parseMacsListback to summary
public static BuiltinMacs.ParseResult parseMacsList(Collection<String> macs)
registerExtensionback to summary
public static void registerExtension(MacFactory extension)

Registered a NamedFactory to be available besides the built-in ones when parsing configuration

Parameters
extension:MacFactory

The factory to register

Exceptions
IllegalArgumentException:
if factory instance is null, or overrides a built-in one or overrides another registered factory with the same name (case insensitive).
resolveFactoryback to summary
public static MacFactory resolveFactory(String name)
Parameters
name:String

The factory name

Returns:MacFactory

The factory or null if it is neither a built-in one or a registered extension

toStringback to summary
public final String toString()

Overrides java.lang.Enum.toString.

Doc from java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists.

Returns:String

the name of this enum constant

Annotations
@Override
unregisterExtensionback to summary
public static MacFactory unregisterExtension(String name)

Unregisters specified extension

Parameters
name:String

The factory name - ignored if null/empty

Returns:MacFactory

The registered extension - null if not found

valueOfback to summary
public static BuiltinMacs valueOf(String name)
valuesback to summary
public static BuiltinMacs[] values()
org.apache.sshd.common.mac back to summary

public final Class BuiltinMacs.Constants

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ETM_HMAC_SHA1back to summary
public static final String ETM_HMAC_SHA1
ETM_HMAC_SHA2_256back to summary
public static final String ETM_HMAC_SHA2_256
ETM_HMAC_SHA2_512back to summary
public static final String ETM_HMAC_SHA2_512
HMAC_MD5back to summary
public static final String HMAC_MD5
HMAC_MD5_96back to summary
public static final String HMAC_MD5_96
HMAC_SHA1back to summary
public static final String HMAC_SHA1
HMAC_SHA1_96back to summary
public static final String HMAC_SHA1_96
HMAC_SHA2_256back to summary
public static final String HMAC_SHA2_256
HMAC_SHA2_512back to summary
public static final String HMAC_SHA2_512

Constructor Detail

Constantsback to summary
private Constants()
org.apache.sshd.common.mac back to summary

public final Class BuiltinMacs.ParseResult

extends NamedFactoriesListParseResult<Mac, MacFactory>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final BuiltinMacs.ParseResult

Constructor Summary

AccessConstructor and Description
public
ParseResult(List<MacFactory> parsed, List<String> unsupported)

Method Summary

Inherited from org.apache.sshd.common.config.NamedFactoriesListParseResult:
toString

Field Detail

EMPTYback to summary
public static final BuiltinMacs.ParseResult EMPTY

Constructor Detail

ParseResultback to summary
public ParseResult(List<MacFactory> parsed, List<String> unsupported)