Package org.apache.sshd.common.digest
Enum BuiltinDigests
- java.lang.Object
-
- java.lang.Enum<BuiltinDigests>
-
- org.apache.sshd.common.digest.BuiltinDigests
-
- All Implemented Interfaces:
Serializable,Comparable<BuiltinDigests>,Supplier<Digest>,AlgorithmNameProvider,DigestFactory,DigestInformation,Factory<Digest>,NamedFactory<Digest>,NamedResource,OptionalFeature
public enum BuiltinDigests extends Enum<BuiltinDigests> implements DigestFactory
Provides easy access to the currently implemented digests- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuiltinDigests.Constants
-
Field Summary
Fields Modifier and Type Field Description static Set<BuiltinDigests>VALUES-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
Fields inherited from interface org.apache.sshd.common.OptionalFeature
FALSE, TRUE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Digestcreate()static BuiltinDigestsfromAlgorithm(String algo)static BuiltinDigestsfromDigest(Digest d)static BuiltinDigestsfromFactory(NamedFactory<? extends Digest> factory)static BuiltinDigestsfromFactoryName(String name)static BuiltinDigestsfromString(String s)StringgetAlgorithm()intgetBlockSize()StringgetName()booleanisSupported()StringtoString()static BuiltinDigestsvalueOf(String name)Returns the enum constant of this type with the specified name.static BuiltinDigests[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
md5
public static final BuiltinDigests md5
-
sha1
public static final BuiltinDigests sha1
-
sha224
public static final BuiltinDigests sha224
-
sha256
public static final BuiltinDigests sha256
-
sha384
public static final BuiltinDigests sha384
-
sha512
public static final BuiltinDigests sha512
-
-
Field Detail
-
VALUES
public static final Set<BuiltinDigests> VALUES
-
-
Method Detail
-
values
public static BuiltinDigests[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BuiltinDigests c : BuiltinDigests.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BuiltinDigests valueOf(String name)
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
-
getName
public final String getName()
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-
getAlgorithm
public final String getAlgorithm()
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-
getBlockSize
public final int getBlockSize()
- Specified by:
getBlockSizein interfaceDigestInformation- Returns:
- The number of bytes in the digest's output
-
toString
public final String toString()
- Overrides:
toStringin classEnum<BuiltinDigests>
-
create
public final Digest create()
-
isSupported
public final boolean isSupported()
- Specified by:
isSupportedin interfaceOptionalFeature
-
fromString
public static BuiltinDigests fromString(String s)
- Parameters:
s- TheEnum's name - ignored ifnull/empty- Returns:
- The matching
BuiltinDigestswhoseEnum.name()matches (case insensitive) the provided argument -nullif no match
-
fromFactory
public static BuiltinDigests fromFactory(NamedFactory<? extends Digest> factory)
- Parameters:
factory- TheNamedFactoryfor the cipher - ignored ifnull- Returns:
- The matching
BuiltinDigestswhose factory name matches (case insensitive) the digest factory name - See Also:
fromFactoryName(String)
-
fromFactoryName
public static BuiltinDigests fromFactoryName(String name)
- Parameters:
name- The factory name - ignored ifnull/empty- Returns:
- The matching
BuiltinDigestswhose factory name matches (case insensitive) the provided name -nullif no match
-
fromDigest
public static BuiltinDigests fromDigest(Digest d)
- Parameters:
d- TheDigestinstance - ignored ifnull- Returns:
- The matching
BuiltinDigestswhose algorithm matches (case insensitive) the digets's algorithm -nullif no match
-
fromAlgorithm
public static BuiltinDigests fromAlgorithm(String algo)
- Parameters:
algo- The algorithm to find - ignored ifnull/empty- Returns:
- The matching
BuiltinDigestswhose algorithm matches (case insensitive) the provided name -nullif no match
-
-