def readKmsResponseV4(data): response = kmsRequestV4.ResponseV4(data) hashed = generateHash(bytearray(bytes(response['response']))) print("Response Hash has expected value:", hashed == response['hash']) return response