Package org.apache.sshd.common.digest
Enum BuiltinDigests
- All Implemented Interfaces:
Serializable
,Comparable<BuiltinDigests>
,java.lang.constant.Constable
,Supplier<Digest>
,AlgorithmNameProvider
,DigestFactory
,DigestInformation
,Factory<Digest>
,NamedFactory<Digest>
,NamedResource
,OptionalFeature
Provides easy access to the currently implemented digests
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final int
private final String
private final boolean
static final Set
<BuiltinDigests> 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
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
BuiltinDigests
(String factoryName, String algorithm, int blockSize) -
Method Summary
Modifier and TypeMethodDescriptionfinal Digest
create()
static BuiltinDigests
fromAlgorithm
(String algo) static BuiltinDigests
fromDigest
(Digest d) static BuiltinDigests
fromFactory
(NamedFactory<? extends Digest> factory) static BuiltinDigests
fromFactoryName
(String name) static BuiltinDigests
fromString
(String s) final String
final int
final String
getName()
final boolean
final String
toString()
static BuiltinDigests
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 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:
getName
in interfaceNamedResource
- Returns:
- The resource name
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceAlgorithmNameProvider
-
getBlockSize
public final int getBlockSize()- Specified by:
getBlockSize
in interfaceDigestInformation
- Returns:
- The number of bytes in the digest's output
-
toString
- Overrides:
toString
in classEnum<BuiltinDigests>
-
create
-
isSupported
public final boolean isSupported()- Specified by:
isSupported
in interfaceOptionalFeature
-
fromString
- Parameters:
s
- TheEnum
's name - ignored ifnull
/empty- Returns:
- The matching
BuiltinDigests
whoseEnum.name()
matches (case insensitive) the provided argument -null
if no match
-
fromFactory
- Parameters:
factory
- TheNamedFactory
for the cipher - ignored ifnull
- Returns:
- The matching
BuiltinDigests
whose factory name matches (case insensitive) the digest factory name - See Also:
-
fromFactoryName
- Parameters:
name
- The factory name - ignored ifnull
/empty- Returns:
- The matching
BuiltinDigests
whose factory name matches (case insensitive) the provided name -null
if no match
-
fromDigest
- Parameters:
d
- TheDigest
instance - ignored ifnull
- Returns:
- The matching
BuiltinDigests
whose algorithm matches (case insensitive) the digets's algorithm -null
if no match
-
fromAlgorithm
- Parameters:
algo
- The algorithm to find - ignored ifnull
/empty- Returns:
- The matching
BuiltinDigests
whose algorithm matches (case insensitive) the provided name -null
if no match
-