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>
  • Field Details

    • ECC_SIGNATURE_TYPE_PREFERENCES

      static final List<String> ECC_SIGNATURE_TYPE_PREFERENCES
      ECC signature types in ascending order of preference (i.e., most preferred 1st)
    • RSA_SIGNATURE_TYPE_PREFERENCES

      static final List<String> 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 types
      factories - 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 types
      available - 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

      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 intended PublicKey - ignored if null
      algo - 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:
      The Signature factory or null if no match found
      Throws:
      InvalidKeySpecException - If specified algorithm does not match the selected public key