Top Fields Methods
org.apache.sshd.common.signature

public Interface SignatureFactory

extends BuiltinFactory<Signature>
Known Direct Implementers
org.apache.sshd.common.signature.BuiltinSignatures
Imports
java.security.PublicKey, java.security.interfaces.DSAPublicKey, .ECPublicKey, .RSAPublicKey, java.security.spec.InvalidKeySpecException, java.util.ArrayList, .Arrays, .Collection, .Collections, .HashSet, .List, .Map, .Set, .TreeMap, org.apache.sshd.common.BuiltinFactory, .NamedFactory, .NamedResource, org.apache.sshd.common.config.keys.KeyUtils, org.apache.sshd.common.keyprovider.KeyPairProvider, org.apache.sshd.common.util.GenericUtils, .MapEntryUtils, org.apache.sshd.common.util.security.SecurityUtils

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final List<String>
ECC_SIGNATURE_TYPE_PREFERENCES

ECC signature types in ascending order of preference (i.e., most preferred 1st)

public static final List<String>
RSA_SIGNATURE_TYPE_PREFERENCES

RSA signature types in ascending order of preference (i.e., most preferred 1st)

Method Summary

Modifier and TypeMethod and Description
public static int
public static int
resolvePreferredSignaturePosition(List<String> preferredOrder, int prefValue, Map<String, Integer> posMap)

public static List<String>

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.
resolveSignatureFactoriesProposal
(Iterable<String>
The provided signature key types
provided
,
Collection<? extends NamedFactory<Signature>>
The available signature factories
factories
)

public static NamedFactory<? extends Signature>
resolveSignatureFactory(String keyType, Collection<? extends NamedFactory<? extends Signature>> factories)

public static NamedFactory<Signature>

Returns:

The Signature factory or null if no match found
resolveSignatureFactoryByPublicKey
(PublicKey
The intended PublicKey - ignored if null
pubKey
,
String
The intended signature algorithm - if null/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
algo
)

public static List<String>

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.
resolveSignatureFactoryNamesProposal
(Iterable<String>
The provided signature key types
provided
,
Collection<String>
The available signature factories names
available
)

Inherited from org.apache.sshd.common.BuiltinFactory:
setUpFactories

Field Detail

ECC_SIGNATURE_TYPE_PREFERENCESback to summary
public static final List<String> ECC_SIGNATURE_TYPE_PREFERENCES

ECC signature types in ascending order of preference (i.e., most preferred 1st)

RSA_SIGNATURE_TYPE_PREFERENCESback to summary
public static final List<String> RSA_SIGNATURE_TYPE_PREFERENCES

RSA signature types in ascending order of preference (i.e., most preferred 1st)

Method Detail

resolvePreferredSignaturePositionback to summary
public static int resolvePreferredSignaturePosition(List<? extends NamedFactory<Signature>> factories, NamedFactory<Signature> factory)
resolvePreferredSignaturePositionback to summary
public static int resolvePreferredSignaturePosition(List<String> preferredOrder, int prefValue, Map<String, Integer> posMap)
resolveSignatureFactoriesProposalback to summary
public static List<String> resolveSignatureFactoriesProposal(Iterable<String> provided, Collection<? extends NamedFactory<Signature>> factories)
Parameters
provided:Iterable<String>

The provided signature key types

factories:Collection<? extends NamedFactory<Signature>>

The available signature factories

Returns:List<String>

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(Iterable, Collection)
resolveSignatureFactoryback to summary
public static NamedFactory<? extends Signature> resolveSignatureFactory(String keyType, Collection<? extends NamedFactory<? extends Signature>> factories)
resolveSignatureFactoryByPublicKeyback to summary
public static NamedFactory<Signature> resolveSignatureFactoryByPublicKey(PublicKey pubKey, String algo) throws InvalidKeySpecException
Parameters
pubKey:PublicKey

The intended PublicKey - ignored if null

algo:String

The intended signature algorithm - if null/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:NamedFactory<Signature>

The Signature factory or null if no match found

Exceptions
InvalidKeySpecException:
If specified algorithm does not match the selected public key
resolveSignatureFactoryNamesProposalback to summary
public static List<String> resolveSignatureFactoryNamesProposal(Iterable<String> provided, Collection<String> available)
Parameters
provided:Iterable<String>

The provided signature key types

available:Collection<String>

The available signature factories names

Returns:List<String>

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.