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
public interface SignatureFactory extends BuiltinFactory<Signature>
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>ECC_SIGNATURE_TYPE_PREFERENCESECC signature types in ascending order of preference (i.e., most preferred 1st)static List<String>RSA_SIGNATURE_TYPE_PREFERENCESRSA 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 Methods Modifier and Type Method Description static intresolvePreferredSignaturePosition(List<? extends NamedFactory<Signature>> factories, NamedFactory<Signature> factory)static intresolvePreferredSignaturePosition(List<String> preferredOrder, int prefValue, Map<String,Integer> posMap)static List<String>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)static List<String>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
-
-
-
-
Method Detail
-
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
Listof 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(Iterable, Collection)
-
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
Listof 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
static int resolvePreferredSignaturePosition(List<String> preferredOrder, int prefValue, Map<String,Integer> posMap)
-
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 ifnullalgo- 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
Signaturefactory ornullif no match found - Throws:
InvalidKeySpecException- If specified algorithm does not match the selected public key
-
-