Package org.apache.sshd.common.digest
Enum BuiltinDigests
- All Implemented Interfaces:
Serializable,Comparable<BuiltinDigests>,Supplier<Digest>,AlgorithmNameProvider,DigestFactory,DigestInformation,Factory<Digest>,NamedFactory<Digest>,NamedResource,OptionalFeature
Provides easy access to the currently implemented digests
-
Nested Class Summary
Nested Classes -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final intprivate final Stringprivate final booleanstatic final Set<BuiltinDigests> 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
ConstructorsModifierConstructorDescriptionprivateBuiltinDigests(String factoryName, String algorithm, int blockSize) -
Method Summary
Modifier and TypeMethodDescriptionfinal Digestcreate()static BuiltinDigestsfromAlgorithm(String algo) static BuiltinDigestsfromDigest(Digest d) static BuiltinDigestsfromFactory(NamedFactory<? extends Digest> factory) static BuiltinDigestsfromFactoryName(String name) static BuiltinDigestsfromString(String s) final Stringfinal intfinal StringgetName()final booleanfinal StringtoString()static BuiltinDigestsReturns 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 Details
-
md5
-
sha1
-
sha224
-
sha256
-
sha384
-
sha512
-
-
Field Details
-
VALUES
-
algorithm
-
blockSize
private final int blockSize -
factoryName
-
supported
private final boolean supported
-
-
Constructor Details
-
BuiltinDigests
-
-
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
-
getName
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-
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
- Overrides:
toStringin classEnum<BuiltinDigests>
-
create
-
isSupported
public final boolean isSupported()- Specified by:
isSupportedin interfaceOptionalFeature
-
fromString
- Parameters:
s- TheEnum's name - ignored ifnull/empty- Returns:
- The matching
BuiltinDigestswhoseEnum.name()matches (case insensitive) the provided argument -nullif no match
-
fromFactory
- Parameters:
factory- TheNamedFactoryfor the cipher - ignored ifnull- Returns:
- The matching
BuiltinDigestswhose factory name matches (case insensitive) the digest factory name - See Also:
-
fromFactoryName
- Parameters:
name- The factory name - ignored ifnull/empty- Returns:
- The matching
BuiltinDigestswhose factory name matches (case insensitive) the provided name -nullif no match
-
fromDigest
- Parameters:
d- TheDigestinstance - ignored ifnull- Returns:
- The matching
BuiltinDigestswhose algorithm matches (case insensitive) the digets's algorithm -nullif no match
-
fromAlgorithm
- Parameters:
algo- The algorithm to find - ignored ifnull/empty- Returns:
- The matching
BuiltinDigestswhose algorithm matches (case insensitive) the provided name -nullif no match
-