original_docstring: Find the cryptography hash function given the string output from asn1crypto SignedDigestAlgorithm.
  
      Todo: There should be a better way to do this?
  
      Args:
            algorithm (DigestAlgorithm): The asn1crypto Signed Digest Algorithm
      Returns:
          Union[Type[hashes.SHA1], Type[hashes.SHA256], Type[hashes.SHA512]] A cryptography hash function for use with
           signature verification.
      
docstring: Find the cryptography hash function given the string output from asn1crypto SignedDigestAlgorithm.
docstring_tokens: Find the cryptography hash function given the string output from asn1crypto SignedDigestAlgorithm .
code: def _cryptography_hash_function(algorithm: DigestAlgorithm) -> Union[None, Type[hashes.SHA1], Type[hashes.SHA256], Type[hashes.SHA512]]:
      """Find the cryptography hash function given the string output from asn1crypto SignedDigestAlgorithm.
  
      Todo: There should be a better way to do this?
  
      Args:
            algorithm (DigestAlgorithm): The asn1crypto Signed Digest Algorithm
      Returns:
          Union[Type[hashes.SHA1], Type[hashes.SHA256], Type[hashes.SHA512]] A cryptography hash function for use with
           signature verification.
      """
  
      hash_algo = algorithm['algorithm'].native
  
      if hash_algo == "sha1":
          return hashes.SHA1
      elif hash_algo == "sha256":
          return hashes.SHA256
      elif hash_algo == "sha512":
          return hashes.SHA512
      else:
          return None
code_tokens: def _cryptography_hash_function ( algorithm : DigestAlgorithm ) -> Union [ None , Type [ hashes . SHA1 ] , Type [ hashes . SHA256 ] , Type [ hashes . SHA512 ] ] : hash_algo = algorithm [ 'algorithm' ] . native if hash_algo == "sha1" : return hashes . SHA1 elif hash_algo == "sha256" : return hashes . SHA256 elif hash_algo == "sha512" : return hashes . SHA512 else : return None
short_docstring: Find the cryptography hash function given the string output from asn1crypto SignedDigestAlgorithm.
short_docstring_tokens: Find the cryptography hash function given the string output from asn1crypto SignedDigestAlgorithm .
comment: """Find the cryptography hash function given the string output from asn1crypto SignedDigestAlgorithm.
  
      Todo: There should be a better way to do this?
  
      Args:
            algorithm (DigestAlgorithm): The asn1crypto Signed Digest Algorithm
      Returns:
          Union[Type[hashes.SHA1], Type[hashes.SHA256], Type[hashes.SHA512]] A cryptography hash function for use with
           signature verification.
      """