def METHOD_NAME(padStr, mgf=padding.MGF1, h=hashes.SHA256, label=None):
    if padStr == "pkcs":
        return padding.PKCS1v15()
    elif padStr == "pss":
        # Can't find where this is written, but we have to use the digest
        # size instead of the automatic padding.PSS.MAX_LENGTH.
        return padding.PSS(mgf=mgf(h), salt_length=h.digest_size)
    elif padStr == "oaep":
        return padding.OAEP(mgf=mgf(h), algorithm=h, label=label)
    else:
        warning("Key.encrypt(): Unknown padding type (%s)", padStr)
        return None