Package org.apache.sshd.common.signature
Enum BuiltinSignatures
- All Implemented Interfaces:
Serializable
,Comparable<BuiltinSignatures>
,java.lang.constant.Constable
,Supplier<Signature>
,BuiltinFactory<Signature>
,Factory<Signature>
,NamedFactory<Signature>
,NamedResource
,OptionalFeature
,SignatureFactory
Provides easy access to the currently implemented signatures
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Holds the result of theparseSignatureList(String)
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeprecated.Deprecated.Deprecated. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map
<String, SignatureFactory> private final String
static final Set
<BuiltinSignatures> 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
Fields inherited from interface org.apache.sshd.common.signature.SignatureFactory
ECC_SIGNATURE_TYPE_PREFERENCES, RSA_SIGNATURE_TYPE_PREFERENCES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BuiltinSignatures
fromFactory
(NamedFactory<Signature> factory) static BuiltinSignatures
fromFactoryName
(String name) static BuiltinSignatures
fromString
(String s) static BuiltinSignatures
getFactoryByCurveSize
(ECParameterSpec params) final String
getName()
static NavigableSet
<SignatureFactory> static Signature
getSignerByCurveSize
(ECParameterSpec params) boolean
parseSignatureList
(String sigs) parseSignatureList
(String... sigs) parseSignatureList
(Collection<String> sigs) static void
registerExtension
(SignatureFactory extension) Registered aNamedFactory
to be available besides the built-in ones when parsing configurationstatic SignatureFactory
resolveFactory
(String name) final String
toString()
static SignatureFactory
unregisterExtension
(String name) Unregisters specified extensionstatic BuiltinSignatures
Returns the enum constant of this type with the specified name.static BuiltinSignatures[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
dsa
Deprecated.- See Also:
-
dsa_cert
Deprecated.- See Also:
-
rsa
-
rsa_cert
Deprecated.- See Also:
-
rsaSHA256
-
rsaSHA256_cert
-
rsaSHA512
-
rsaSHA512_cert
-
nistp256
-
nistp256_cert
-
nistp384
-
nistp384_cert
-
nistp521
-
nistp521_cert
-
sk_ecdsa_sha2_nistp256
-
ed25519
-
ed25519_cert
-
sk_ssh_ed25519
-
-
Field Details
-
VALUES
-
EXTENSIONS
-
factoryName
-
-
Constructor Details
-
BuiltinSignatures
-
-
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
-
getFactoryByCurveSize
-
getSignerByCurveSize
-
getName
- Specified by:
getName
in interfaceNamedResource
- Returns:
- The resource name
-
toString
- Overrides:
toString
in classEnum<BuiltinSignatures>
-
isSupported
public boolean isSupported()- Specified by:
isSupported
in interfaceOptionalFeature
-
registerExtension
Registered aNamedFactory
to 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
NavigableSet
of 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 -
null
if not found
-
fromString
- Parameters:
s
- TheEnum
's name - ignored ifnull
/empty- Returns:
- The matching
BuiltinSignatures
whoseEnum.name()
matches (case insensitive) the provided argument -null
if no match
-
fromFactory
- Parameters:
factory
- TheNamedFactory
for the signature - ignored ifnull
- Returns:
- The matching
BuiltinSignatures
whose factory name matches (case insensitive) the digest factory name - See Also:
-
fromFactoryName
- Parameters:
name
- The factory name - ignored ifnull
/empty- Returns:
- The matching
BuiltinSignatures
whose factory name matches (case insensitive) the provided name -null
if no match
-
parseSignatureList
- Parameters:
sigs
- A comma-separated list of signatures' names - ignored ifnull
/empty- Returns:
- A
BuiltinSignatures.ParseResult
of all theNamedFactory
whose name appears in the string and represent a built-in signature. Any unknown name is ignored. The order of the returned result is the same as the original order - bar the unknown signatures. Note: it is up to caller to ensure that the list does not contain duplicates
-
parseSignatureList
-
parseSignatureList
-
resolveFactory
- Parameters:
name
- The factory name- Returns:
- The factory or
null
if it is neither a built-in one or a registered extension
-