MCPcopy Index your code
hub / github.com/saltstack/salt / parse_hash

Method parse_hash

salt/crypt.py:317–323  ·  view source on GitHub ↗
(algorithm)

Source from the content-addressed store, hash-verified

315
316 @staticmethod
317 def parse_hash(algorithm):
318 if "-" not in algorithm:
319 raise UnsupportedAlgorithm(f"Invalid encryption algorithm: {algorithm}")
320 _pad, _hash = algorithm.split("-", 1)
321 if _hash not in VALID_HASHES:
322 raise Exception("Invalid hashing algorithm")
323 return getattr(hashes, _hash)
324
325 @staticmethod
326 def _enforce_fips(algorithm):

Callers 4

signMethod · 0.80
decryptMethod · 0.80
encryptMethod · 0.80
verifyMethod · 0.80

Calls 1

Tested by

no test coverage detected