Class DefaultSignatureAlgorithmIdentifierFinder

java.lang.Object
org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder
All Implemented Interfaces:
AlgorithmIdentifierFinder, SignatureAlgorithmIdentifierFinder

public class DefaultSignatureAlgorithmIdentifierFinder extends Object implements SignatureAlgorithmIdentifierFinder
  • Constructor Details

    • DefaultSignatureAlgorithmIdentifierFinder

      public DefaultSignatureAlgorithmIdentifierFinder()
  • Method Details

    • hasAlgorithm

      public boolean hasAlgorithm(String sigAlgName)
      Return true if a signature algorithm of the passed in name is recognised, false otherwise. Where this returns true find(String) returns an identifier; where it returns false find throws, so this is the way to test for support without catching.

      Declared here rather than on SignatureAlgorithmIdentifierFinder, which is long published - adding a method there would break every implementation outside this library.

      Parameters:
      sigAlgName - the name of the signature algorithm of interest.
      Returns:
      true if the name is recognised, false otherwise.
    • find

      public org.bouncycastle.asn1.x509.AlgorithmIdentifier find(String sigAlgName)
      Description copied from interface: SignatureAlgorithmIdentifierFinder
      Find the signature algorithm identifier that matches with the passed in signature algorithm name.
      Specified by:
      find in interface AlgorithmIdentifierFinder
      Specified by:
      find in interface SignatureAlgorithmIdentifierFinder
      Parameters:
      sigAlgName - the name of the signature algorithm of interest.
      Returns:
      an algorithm identifier for the corresponding signature.