Package org.apache.sshd.common.signature
Enum BuiltinSignatures
- All Implemented Interfaces:
Serializable,Comparable<BuiltinSignatures>,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 classHolds the result of theparseSignatureList(String) -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeprecated.Deprecated.Deprecated. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<String, SignatureFactory> private final Stringstatic final Set<BuiltinSignatures> Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTORFields inherited from interface org.apache.sshd.common.OptionalFeature
FALSE, TRUEFields 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 BuiltinSignaturesfromFactory(NamedFactory<Signature> factory) static BuiltinSignaturesfromFactoryName(String name) static BuiltinSignaturesfromString(String s) static BuiltinSignaturesgetFactoryByCurveSize(ECParameterSpec params) final StringgetName()static NavigableSet<SignatureFactory> static SignaturegetSignerByCurveSize(ECParameterSpec params) booleanparseSignatureList(String sigs) parseSignatureList(String... sigs) parseSignatureList(Collection<String> sigs) static voidregisterExtension(SignatureFactory extension) Registered aNamedFactoryto be available besides the built-in ones when parsing configurationstatic SignatureFactoryresolveFactory(String name) final StringtoString()static SignatureFactoryunregisterExtension(String name) Unregisters specified extensionstatic BuiltinSignaturesReturns 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:
getNamein interfaceNamedResource- Returns:
- The resource name
-
toString
- Overrides:
toStringin classEnum<BuiltinSignatures>
-
isSupported
public boolean isSupported()- Specified by:
isSupportedin interfaceOptionalFeature
-
registerExtension
Registered aNamedFactoryto 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
NavigableSetof 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 -
nullif not found
-
fromString
- Parameters:
s- TheEnum's name - ignored ifnull/empty- Returns:
- The matching
BuiltinSignatureswhoseEnum.name()matches (case insensitive) the provided argument -nullif no match
-
fromFactory
- Parameters:
factory- TheNamedFactoryfor the signature - ignored ifnull- Returns:
- The matching
BuiltinSignatureswhose factory name matches (case insensitive) the digest factory name - See Also:
-
fromFactoryName
- Parameters:
name- The factory name - ignored ifnull/empty- Returns:
- The matching
BuiltinSignatureswhose factory name matches (case insensitive) the provided name -nullif no match
-
parseSignatureList
- Parameters:
sigs- A comma-separated list of signatures' names - ignored ifnull/empty- Returns:
- A
BuiltinSignatures.ParseResultof all theNamedFactorywhose 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
nullif it is neither a built-in one or a registered extension
-