Package org.apache.sshd.common.signature
Interface SignatureFactory
- All Superinterfaces:
BuiltinFactory<Signature>
,Factory<Signature>
,NamedFactory<Signature>
,NamedResource
,OptionalFeature
,Supplier<Signature>
- All Known Implementing Classes:
BuiltinSignatures
-
Field Summary
FieldsModifier and TypeFieldDescriptionECC signature types in ascending order of preference (i.e., most preferred 1st)RSA signature types in ascending order of preference (i.e., most preferred 1st)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
Static MethodsModifier and TypeMethodDescriptionstatic int
resolvePreferredSignaturePosition
(List<? extends NamedFactory<Signature>> factories, NamedFactory<Signature> factory) static int
resolvePreferredSignaturePosition
(List<String> preferredOrder, int prefValue, Map<String, Integer> posMap) resolveSignatureFactoriesProposal
(Iterable<String> provided, Collection<? extends NamedFactory<Signature>> factories) static NamedFactory<? extends Signature>
resolveSignatureFactory
(String keyType, Collection<? extends NamedFactory<? extends Signature>> factories) static NamedFactory<Signature>
resolveSignatureFactoryByPublicKey
(PublicKey pubKey, String algo) resolveSignatureFactoryNamesProposal
(Iterable<String> provided, Collection<String> available) Methods inherited from interface org.apache.sshd.common.NamedResource
getName
Methods inherited from interface org.apache.sshd.common.OptionalFeature
isSupported
-
Field Details
-
ECC_SIGNATURE_TYPE_PREFERENCES
ECC signature types in ascending order of preference (i.e., most preferred 1st) -
RSA_SIGNATURE_TYPE_PREFERENCES
RSA signature types in ascending order of preference (i.e., most preferred 1st)
-
-
Method Details
-
resolveSignatureFactoriesProposal
static List<String> resolveSignatureFactoriesProposal(Iterable<String> provided, Collection<? extends NamedFactory<Signature>> factories) - Parameters:
provided
- The provided signature key typesfactories
- The available signature factories- Returns:
- A
List
of the matching available factories names that are also listed as provided ones - in the same order of preference as they appear in the available listing. May be empty if no provided signature key types, or no available ones or no match found. - See Also:
-
resolveSignatureFactoryNamesProposal
static List<String> resolveSignatureFactoryNamesProposal(Iterable<String> provided, Collection<String> available) - Parameters:
provided
- The provided signature key typesavailable
- The available signature factories names- Returns:
- A
List
of the matching available factories names that are also listed as provided ones - in the same order of preference as they appear in the available listing. May be empty if no provided signature key types, or no available ones or no match found.
-
resolvePreferredSignaturePosition
static int resolvePreferredSignaturePosition(List<? extends NamedFactory<Signature>> factories, NamedFactory<Signature> factory) -
resolvePreferredSignaturePosition
-
resolveSignatureFactory
static NamedFactory<? extends Signature> resolveSignatureFactory(String keyType, Collection<? extends NamedFactory<? extends Signature>> factories) -
resolveSignatureFactoryByPublicKey
static NamedFactory<Signature> resolveSignatureFactoryByPublicKey(PublicKey pubKey, String algo) throws InvalidKeySpecException - Parameters:
pubKey
- The intendedPublicKey
- ignored ifnull
algo
- The intended signature algorithm - ifnull
/empty and multiple signatures available for the key type then a default will be used. Otherwise, it is validated to make sure it matches the public key type- Returns:
- The
Signature
factory ornull
if no match found - Throws:
InvalidKeySpecException
- If specified algorithm does not match the selected public key
-