Class DigestAlgorithmRegistry

java.lang.Object
se.swedenconnect.sigval.commons.algorithms.DigestAlgorithmRegistry

public class DigestAlgorithmRegistry extends Object
Registry of supported digest algorithms
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Constructor Details

    • DigestAlgorithmRegistry

      public DigestAlgorithmRegistry()
  • Method Details

    • registerDigestAlgorithm

      public static boolean registerDigestAlgorithm(String uri, org.bouncycastle.asn1.ASN1ObjectIdentifier oid)
      Register a new supported digest algorithm
      Parameters:
      uri - URI identifier
      oid - Object Identifier (OID)
      Returns:
      true if the digest algorithm was added to the registry
    • get

      public static DigestAlgorithm get(String uri) throws NoSuchAlgorithmException
      Get registered digest algorithm based on URI identifier
      Parameters:
      uri - URI identifier
      Returns:
      digest algorithm
      Throws:
      NoSuchAlgorithmException - if the requested digest algorithm is not in the registry
    • get

      public static DigestAlgorithm get(org.bouncycastle.asn1.ASN1ObjectIdentifier oid) throws NoSuchAlgorithmException
      Get registered digest algorithm based on OID
      Parameters:
      oid - Object Identifier (OID)
      Returns:
      digest algorithm
      Throws:
      NoSuchAlgorithmException - if the requested digest algorithm is not in the registry