Integrity verification middleware for Swift